visual-studio-2017nuget-package-restoreasp.net-core-1.1.net-core-1.1

NuGet Package Manager not working in Visual Studio 2017 - for a.NET Core 1.1 web application


I just created a .NET Core Web Application in VS2017 and I wanted to be able to serve a single page application. In order to be able to do that I tried to install the nuget package Microsoft.AspNetCore.StaticFiles. But my NuGet installer failed and threw the following error

Severity Code Description Project File Line Suppression State Package restore failed. Rolling back package changes for 'MyApp'.


Solution

  • Right click on the project=>Properties and set TargetFramework to .net core 2.0(less than or equal to the packages version you are using)

    build the project and then install whatever you want from nuget.