Visual Studio 2017 cannot update Microsoft.NETCore.App package ("Blocked by project")

Solution 1:

EDIT 2018: Only follow the instructions for updating the package if you really know what you are doing. In most cases, you never need to update this package - or other packages marked as "blocked by project" - manually. A framework-dependent app will use the latest runtime available and a self-contained application will perform an extra build using a newer version of this package automatically. (there are some edge cases where you need to upgrade this package in test projects. in this case, add <TargetLatestRuntimePatch>true</…> and see this Q&A for other options)

The implicit package references that the Microsoft.NET.Sdk infers can't be updated via NuGet.

If you migrated from project.json, the project with the 1.1.0 reference likely contains

<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>

in the csproj file or an item like this (if you may used the package manager previously to set the version):

<PackageReference Update="Microsoft.NETCore.App" Version="1.1.0" />

Delete entries like the above and all packages will reference 1.1.2 (or whatever the installed SDK considers to be the latest) automatically. Alernatively, set RuntimeFrameworkVersion in all projects.

Solution 2:

I had similar problem trying to install Entityframework.Core package in a .NET Core 2 Web app. To solve the issue, I've forced installation through Package Manager Console:

Install-Package Microsoft.NETCore.App -Version 2.0.5

(2.0.5 was the most recent version at the time)

I hope it's useful. Peace.

Solution 3:

For me adding

<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>

did the trick

<PropertyGroup>
  <TargetFramework>netcoreapp2.1</TargetFramework>
  <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
  <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>