I am working on migrating Xamarin.forms to .net maui.
I am using Xamarin.CardIO.iOS nugget to scan credit card.
when migrating to .net maui I have updated all the nuget packages to latest.
getting below error
Package Xamarin.CardIO.iOS 5.4.1 is not compatible with net6.0-ios16.0 (.NETCoreApp,Version=v6.0) / ios-arm64. Package Xamarin.CardIO.iOS 5.4.1 supports: xamarinios10 (Xamarin.iOS,Version=v1.0)
is there any other nuget package for credit card scanning which supports .net maui for iOS.
Related
I am following this tutorial:
https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=visual-studio
I am immediately stopped because I can not complete the following command:
Install-Package Microsoft.EntityFrameworkCore.Sqlite
This is the error:
Could not install package 'Microsoft.EntityFrameworkCore.Sqlite.Core 7.0.0'. You are trying to install a package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I am attempting to learn how to use the Entity Framework and so I don't know much regarding this. Any advice would be helpful even if it's a link to something I need to read.
About the tutorial
The tutorial is about .netCore but in the error message you can see that you created a .netFramework project '.NETFramework,Version=v4.7.2'.
Create a new console application, but don't select projects that have (.NET Framework) in the description.
About the Sqlite package (only if continue the practicing with .netFramework)
The command Install-Package Microsoft.EntityFrameworkCore.Sqlite will try to install the last version. Currently, the last version is 7.0.0. This version only work with .NET 6.0.
You can check existing .net versions right here
So, you need to specify the version. The version for .NET 4.7.2 is the 3.1.31.
Install-Package Microsoft.EntityFrameworkCore.Sqlite -Version 3.1.31
Nuget Sqlite package info here
I have a C# .NET Core 3.1 console application. I need to query a SQL database via stored procedures for data retrieval.
I've been trying to use NuGet to install Microsoft.EntityFrameworkCore packages into the projects.
I get errors saying that Entity Framework Core 5.0 is not compatible with .Net Core 3.1. I've tried earlier versions of Entity Framework Core, but I still get compatibility errors.
Should I be trying to use Entity Framework Core with .NET Core? Is there a way around these compatibility issues?
How do I call SQL stored procedures from EF Core?
Here are the errors I'm seeing when I try to add EntityFrameworkCore.SQL package to my solution via NuGet:
Error Package restore failed. Rolling back package changes for 'Foo.WebAPI'.
Error NU1202 Package Microsoft.Extensions.DependencyInjection 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.DependencyInjection 5.0.0 does not support any target frameworks.
Error NU1202 Package Microsoft.IdentityModel.Tokens 5.6.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.IdentityModel.Tokens 5.6.0 does not support any target frameworks.
Error NU1202 Package System.Net.NameResolution 4.3.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package System.Net.NameResolution 4.3.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)
Hopefully you were able to get around the install issues you were having with .net core 3.1->5.0 upgrade. One approach there might be to just start over with a new .net core console app targeted to core 5.0 and move all your buisness logic, etc into the new console app. If you did get through the upgrade issues, here's an answer to your question above.
var user = "johndoe";
var blogs = context.Blogs
.FromSqlRaw("EXECUTE dbo.GetMostPopularBlogsForUser {0}", user)
.ToList();
from Microsoft Docs "Raw Queries" https://learn.microsoft.com/en-us/ef/core/querying/raw-sql
Personally I try to avoic using SP's in code first EF like the plauge, but there are rare occasions where LINQ and EF cant handle the job and you have to goto SP's.
I have a .NET Core solution which was running well using .NET Core 3.1 using a Pipeline on Azure Devops. Everything was working fine on the Pipeline.
After moving from .NET Core 3.1 to .NET 5.0, I started to have some strange troubles running the pipeline, specifically with Nuget packages.
I can build with no problems, but when it starts to pack using Nuget Package, I've got this error:
[error] The nuget command failed with exit code(1)
NU1202: Package Microsoft.EntityFrameworkCore 5.0.0 is not compatible with net50 (.NETFramework,Version=v5.0). Package Microsoft.EntityFrameworkCore 5.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1)
Some weird fact is that this solution is running fine at the local machine.
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.8.8.9</Version>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
I already tried to change the OS on the Build, but I've got this error:
The current available version of MSBuild is 16.7.0.37604. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
Does someone have an idea?
Package Microsoft.EntityFrameworkCore.Relational 5.0.0 supports:
netstandard2.1 (.NETStandard,Version=v2.1)
This is because it was using an old version of Nuget. You can try to change it to 5.x and restore.
Here is a case with similar issue you can refer to.
Is it possible to add the lower version of a library as a NuGet package on the https://www.nuget.org/ site?
For example, I have already uploaded versions:
1.1
1.1.1
1.1.2
1.1.3
1.2
Now I need to add the version 1.1.4.
How can I do this?
Will the Visual Studio NuGet manager return 1.2 as the latest version by default? Or will it change on 1.1.4?
Currently Microsoft.EntityFrameworkCore.Tools.DotNet V2.0.1 is showing a dependency of .NetCoreApp Version = 2.0
Any reason why that isnt version >=2.0 ?
Any idea when support for the more recent versions of
.NetCore SDK will be available
EDIT: Added screenshot
See dependency listed as .NetCoreApp = v2.0 and not .NetStandard = V2.0 or >= CoreApp V2.0 for similar packages.
edit2:
I ran the following new Project tests:
i still think there is an issue here.
I have .netcore sdk 2.1.4 installed
I started with brand new solution in VS2017 15.5.5
I create a new core project
netcoreapp2.0
and a new standard project
netstandard2.0
These packages
o Microsoft.EntityFrameworkCore.tools v2.0.1
o Microsoft.EntityFrameworkCore.design v2.0.1
o Microsoft.EntityFrameworkCore v2.0.1
o Microsoft.EntityFrameworkCore.Sqlite
can all be successfully installed in both projects
netstandard2.0
and
netcoreapp2.0
However:
Microsoft.EntityFrameworkCore.Tools.DotNet v2.0.1
can not be installed in netstandard2.0 project, which I can live with and the error makes some sense.
Restoring packages for C:_Dev\PJSTest\PJSStd\PJSStd.csproj... Package
Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1 is not compatible
with netstandard2.0 (.NETStandard,Version=v2.0). Package
Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1 supports:
netcoreapp2.0 (.NETCoreApp,Version=v2.0) Package restore failed.
Rolling back package changes for 'PJSStd'. Time Elapsed:
00:00:00.1634807
========== Finished ==========
BUT
Microsoft.EntityFrameworkCore.Tools.DotNet v2.0.1
can not be even be installed in a netcoreapp2.0 project
Restoring packages for C:_Dev\EFTEST\EFCore\EFCore.csproj... Detected
package downgrade: Microsoft.NETCore.App from 2.0.3 to 2.0.0.
Reference the package directly from the project to select a different
version. EFCore -> Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1
-> Microsoft.NETCore.App (>= 2.0.3) EFCore -> Microsoft.NETCore.App (>= 2.0.0) Package restore failed. Rolling back package changes for
'EFCore'. Time Elapsed: 00:00:01.1413809
========== Finished ==========
I think there is an issue with versioning on the CoreApp dependency.
I'm happy to be corrected, but my understanding is that .NetCoreApp (v2) is the platform, whereas .NetCore.App (v2.0.5, currently) is the set of API's that target that platform.
So the fact that Microsoft.EntityFrameworkCore.Tools.DotNet V2.0.1 only points to .NetCoreApp,Version = 2.0 means it can only support the apis from that platform... which says nothing about what platforms those dependencies support. e.g. you if you take a further and look inside at the Microsoft.NetCore.App dependencies, you will see listings under .NetCoreApp,Version = 1.0 up to 2.0.
EDIT: My understanding of various .NET core versioning landscape goes as follows:
The .NET Core SDK version is 2.1.5. This allows the building of .NET standard and .NET core apps.
The Microsoft.EntityFrameworkCore.Tools.DotNet version is 2.0.1. This references .netcoreapp2.0
.netcoreapp2.0 is the platform that implements Microsoft.NetCore.App, which is currently version 2.0.5 of the runtime.
The key part of netcoreapp2.0 is its dependence on .NETStandard.Library (netstandard2.0) but netstandard2.0 does not depend on netcoreapp2.0. I think this answer explains it better than I can. So the EntityFramework cli tools won't work on a library that uses .netstandard2.0 because it targets .netcoreapp2.0. Incidentally, EFCore does work - because it targets .netstandard - just the tools won't.
In summary, the SDK that you have, at version 2.1.4, already contains the necessary .NET Core platforms and runtimes. So no downgrade to the original version 2 is required. What needs to happen is that the csproj has to be updated to target the .NET Core runtime instead in order to use the tools: <TargetFramework>netcoreapp2.0</TargetFramework>.
EDIT2: Here's a sample of a csproj file that targets .netstandard (so that UWP can reference it), and is able to use the EFCore tools.DotNet:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />
</ItemGroup>
</Project>
The Microsoft.EntityFrameworkCore.Tools is a package reference that targets .NET Standard. the Microsoft.EntityFrameworkCore.Tools.DotNet is a tools reference and is treated differently to package references. So the versioning and targets are also a little different.