0
I’m starting an angular application with ASP.Net, and in the video I’m seeing, the instructor says we install Microsoft.Entityframework through Nuget, but I’m having this error:
Severity Code Description Project File Line Suppression State Error
NETSDK1045 The current .NET SDK does not support targeting .NET Core 2.2.
Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that
supports .NET Core 2.2. WebAPI
C:\Program Files\dotnet\sdk\2.1.505\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 137
However the installed version of my . NET is already 2.2
What version of the Entity Framework are you trying to install ? Sometimes the version is incompatible with the version of Core that is installed, which apparently is the message that is being presented to you.
– Felippe Tadeu
Felippe, I tended almost all (including 1.0.0)! I switched to the . NET SDK
– Ravel Sbrissa Okada
Try going to Tools -> Options Projects and Solutions -> . NET Core and check the Use previous versions of . NET Core
– Felippe Tadeu
@Ravelsbrissaokada Qual . NET you are using?
– Jéf Bueno
.NET Core 2.2 SDK - (v2.2.203)
– Ravel Sbrissa Okada
Felippe, continued with the same mistake!
– Ravel Sbrissa Okada
@Ravelsbrissaokada you tried to do what I had written in my last comment ?
– Felippe Tadeu
Yes @Felippetadeu
– Ravel Sbrissa Okada
Typo
dotnet --info
on the console and see which version is being shown– Felippe Tadeu
2.2.203 Taking advantage of the hook, the fact that the SDK is installed on the SSD and the Visual Studio code on the hard drive may be interfering? I remembered this now
– Ravel Sbrissa Okada
Make a global.json file and point to it the sdk that will be used
– Lucas Miranda
Using the @Lucasmiranda comment, it may be that the version is also pointing to the wrong one
– Felippe Tadeu
@Lucasmiranda could instruct me better how to do this, I’m really new in this area
– Ravel Sbrissa Okada
The following link covers the entire procedure https://docs.microsoft.com/pt-br/dotnet/core/tools/global-json
– Lucas Miranda
The error persists, I go to college now so it is possible that I will stop giving back the solutions. I thank you anyway.
– Ravel Sbrissa Okada
Friend, at the core you need to install Microsoft.Entityframeworkcore and not Microsoft.Entityframework, remove and install the right package: Install-Package Microsoft.Entityframeworkcore -Version 2.2.4
– Rafael
Friends, the problem has been solved, I returned my SDK one version and it worked
– Ravel Sbrissa Okada