EdmGen.exe is not supporting targetversion 4.7.2.
Exception thrown as "error 7025: Only .NET Framework version 4 and 4.5 are supported. To use another version use the tools that shipped with that version."
To the best of my knowledge there is latest version of EdmGen.exe. Is there any way that I can generate edmx with target .net framework version 4.7.2 ...?
Related
I have installed Visual Code 2022 preview (17.1). I have created a simple console app following https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli
When I try to add a migration I get the following error
> dotnet ef migrations add One
Build started...
Build succeeded.
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.0.0' (x64) was not found.
- The following frameworks were found:
5.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=win10-x64
Why would it want dot net 2.0?
Add the package Microsoft.EntityFrameworkCore.Design to your main project. if that doesn't work, add to your Data Access layer (project).
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'm trying to build a .netcore 1.1 console project using postsharp 5.0.31 on macOS Sierra, but when I run the command line:
dotnet build
The build fail and show the next output;
MacBook-Pro:PostsharpSample userx$ dotnet build
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
PostsharpSample -> /Users/userx/Documents/VSCode/netcore/PostsharpSample/bin/Debug/netcoreapp1.1/PostsharpSample.dll/Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.targets(564,5): error MSB4062:
The "PostSharp.MSBuild.PostSharp30ChangeAppConfig" task could not be loaded from the assembly /Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.MSBuild.v5.0.31.Release.dll.
Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
The system cannot find the file specified. [/Users/userx/Documents/VSCode/netcore/PostsharpSample/PostsharpSample.csproj]/Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.targets(564,5):
error MSB4062: Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/Users/userx/Documents/VSCode/netcore/PostsharpSample/PostsharpSample.csproj]
It is possible to use .netcore and Postsharp on macOS Sierra?
I need specific configuration?
As of version 5.0, PostSharp does not support building under any OS other the Windows. .NET Core is supported only as a target framework for your projects.
Please refer to http://doc.postsharp.net/requirements for latest information on compatibility.
You can also vote for adding support for .NET Core as a build platform on this UserVoice page: Support for CoreCLR as a build platform (including Linux, iOS).
wanted to check my EF version number - Properties says 6.0.0.0, so I used the PM console to Install-Package EntityFramework & it (the PM Console) reports EntityFramework 6.1.2 already installed.
I'm using .Net framework 4.5 so I'm expecting no problems. Does EF in fact report the most current version under properties, or does it always say 6.0.0.0? Any advice?
Look at the file properties of EntityFramework.dll in Windows Explorer, and you will see a product version of 6.1.2 - the 6.0.0.0 version is the assembly version
I have tried EF 4.1.10715 and EF 4.1.10331.0 both packages seem to target Framework 3.5, but have dependencies on mscorlib, Version 4.0.0.0
Below is screenshot of Package Config for Version 4.1.10331.0 from this morning.
At compilation, we fail with
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3258: The primary reference "EntityFramework" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.
Any ideas?
After created a new WinForm project in Visual Studio 2012 with .NET 3.5 as the target framework, I installed the 4.1.10715.0 version of Entity Framework and had the same issues.
Opening the referenced EntityFramework assembly in dotPeek confirms that it was compiled for .NET 4.0.
Despite the targetFramework indicated 3.5 in packages.config, the referenced assembly has been compiled for .NET 4.0.
<packages>
<package id="EntityFramework" version="4.1.10715.0" targetFramework="net35" /></packages>
Looks like someone mishandled a package prior to publishing.
EntityFramework 4.0+ (including 4.1) do not support .NET Framework 3.5. The only version you can use on a .NET Framework 3.5 is EF1 which is part of the .NET Framework 3.5 SP1. So, if you don't have the SP1 version you won't be able to use EF at all.