I have a dotnet core app that is targetting Microsoft.NETCore.App 1.1.2. I created a test project to test against that project but when building I noticed this warning:
I open the NuGet Package Manager and see that warning is correct, the project being tested has a different version of Microsoft.NETCore.App:
My problem is that Visual Studio is not letting me update that version, so I'm confused on how to solve this issue:
Ideally I would just click the dropdown and select the right version but Visual Studio claims that it cannot do this because of "additional constraints in the project or packages.config". How am I supposed to update that package? What "additional constraints" is Visual Studio referring to?
Best Answer
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 containsin the csproj file or an item like this (if you may used the package manager previously to set the version):
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, setRuntimeFrameworkVersion
in all projects.