https://i.stack.imgur.com/bOqUI.png
https://i.stack.imgur.com/XqkkI.png
https://i.stack.imgur.com/cbxqp.png
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.
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.
For me adding
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
did the trick
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>
Short Answer
Add an explicit version to the Microsoft.AspNetCore.App
package reference in your .csproj file.
Long Answer
I had a brand new netcoreapp2.1 project. The following was in the .csproj file. Note there was no version associated with the Microsoft.AspNetCore.App
package reference.
<ItemGroup>
...
<PackageReference Include="Microsoft.AspNetCore.App" />
...
</ItemGroup>
I added an explicit reference to the Microsoft.Extensions.Logging.Abstractions
package to resolve a dependency mismatch (build error). Micorsoft.AspNetCore.App
wanted version 2.1.0 of this dependency, but another package wanted version 2.1.1. My .csproj file now looked like this.
<ItemGroup>
...
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
...
</ItemGroup>
This reduced the build error to a warning about Micorsoft.AspNetCore.App
requiring the 2.1.0 version of the Microsoft.Extensions.Logging.Abstractions
package but version 2.1.1, of course, was resolved.
Trying to update Micorsoft.AspNetCore.App
to version 2.1.1 to fix the warning was blocked by Package Manager as mentioned by the OP.
I updated my Micorsoft.AspNetCore.App
package reference to explicitly use version 2.1.1 like this.
<ItemGroup>
...
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
...
</ItemGroup>
This fixed the build warning and unblocked all the versions of Microsoft.AspNetCore.App
in Package Manager. I was even able to remove the explicit reference to Microsoft.Extensions.Logging.Abstractions
without reintroducing the original error. The final .csproj looked like this with no issues.
<ItemGroup>
...
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
...
</ItemGroup>
I had same problem and I think, the problem is about the package.
<PackageReference Include="Microsoft.AspNetCore.App" />
The problem was resolved after I specified version exactly.
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
As I know, that error is occured when the version number
Another possible solution. In the csproj
file, update the target framework to the version you wish to upgrade to. After making the change, as per below snippets, the packages can be upgraded via the solution NuGet package manager.
Before:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
After:
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
I solved it by simply: Right clicking on Project (or ALT+ Enter) -> Properties -> Application -> Target Framework (Choose .NET Core framework (in this case 1.1))
The best recommendation is to recreate your projects again after upgrading the SDK and the run time and then drop your old code and configuration inside the new projects. Other than that, you will be spending too much time in useless tweaks and unknown configurations.
Success story sharing
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
line. VS still won't let me manually change the version but at least it's the right version now (it updated to 1.1.2 like you said it would)