JuliusvM
JuliusvM

Reputation: 335

Can't create asp net core 2.0 web api

I'm having serious troubles in my Web Api project. I can't install entityframework nor update any of the updates to the project. Trying to update there gives me the error "package restore failed. rolling back package changes".

First of, I can't make a project with asp net core, only with the 1.1 version even though I have the correct version installed. See these two pictures. enter image description here

enter image description here

As you can see it is installed.

When I try to update these: enter image description here

I get this error: enter image description here

Trying to install entity framework gives me: enter image description here

How can I upgrade my project to asp net core 2.0 or atleast make a new 2.0 project?

Upvotes: 1

Views: 1224

Answers (2)

Kirk Larkin
Kirk Larkin

Reputation: 93273

Support for ASP.NET Core 2.0 was added in Visual Studio 2017 version 15.3 (see the original accouncement).

Your first error is due to the fact that ASP.NET Core 2.0 is not compatible with .NET Core 1.1. You'll need to target .NET Core 2.0 (netcoreapp2.0) for this, as you've attempted to do. Upgrading to Visual Studio 2017 version 15.3 will allow you to do that, as I mentioned above.

Your second error is due to the fact that Entity Framework 6.1.3 is not compatible with .NET Core 1.1 (or, in fact, any version of .NET Core). In order to use Entity Framework in a .NET Core project, you will instead need to use Entity Framework Core (nuget). This is an entirely new version of Entity Framework, so make sure you check out the differences if you haven't already.

Upvotes: 3

firstly check dotNetCore version

Open Command Prompt and run this dotnet --version

install dotnetCore framework lastest on here

alternatively you can update the visual studio

Upvotes: 1

Related Questions