Error in Entityframework Core installation

Asked

Viewed 79 times

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, I tended almost all (including 1.0.0)! I switched to the . NET SDK

  • Try going to Tools -> Options Projects and Solutions -> . NET Core and check the Use previous versions of . NET Core

  • @Ravelsbrissaokada Qual . NET you are using?

  • .NET Core 2.2 SDK - (v2.2.203)

  • Felippe, continued with the same mistake!

  • @Ravelsbrissaokada you tried to do what I had written in my last comment ?

  • Yes @Felippetadeu

  • Typo dotnet --info on the console and see which version is being shown

  • 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

  • 2

    Make a global.json file and point to it the sdk that will be used

  • Using the @Lucasmiranda comment, it may be that the version is also pointing to the wrong one

  • @Lucasmiranda could instruct me better how to do this, I’m really new in this area

  • The following link covers the entire procedure https://docs.microsoft.com/pt-br/dotnet/core/tools/global-json

  • The error persists, I go to college now so it is possible that I will stop giving back the solutions. I thank you anyway.

  • 1

    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

  • Friends, the problem has been solved, I returned my SDK one version and it worked

Show 12 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.