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>