I have an asp.net Core project and I'm trying to add a logger to it. I choose SeriLog which I used in other projects.
But when I'm trying to add the "Serilog.AspNetCore" package version 2.0.0 I'm getting"
Package restore failed. Rolling back package changes for 'BackEnd'.
My csproj contain the following settings:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
<AssemblyName>BackEnd</AssemblyName>
<RootNamespace>BackEnd</RootNamespace>
</PropertyGroup>
Allready tried to clear all nuget cache, rebuilding, restart VS
Running on Win10, Visual Studio 2017 15.3.0
Is there a log that can give me more details why I'm getting this error? Any suggestions how to fix it?
*Update - the detailed build log (Thanks @Leo-MSFT for that):
...
Checking compatibility for System.Security.Cryptography.Csp 4.3.0 with .NETCoreApp,Version=v2.0.
Checking compatibility for runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 with .NETCoreApp,Version=v2.0.
All packages and projects are compatible with .NETCoreApp,Version=v2.0.
Detected package downgrade: Microsoft.Extensions.DependencyInjection from 2.0.0 to 1.1.1. Reference the package directly from the project to select a different version.
BackEnd (>= 1.0.0) -> Serilog.AspNetCore (>= 2.0.0) -> Microsoft.Extensions.DependencyInjection (>= 2.0.0)
BackEnd (>= 1.0.0) -> Microsoft.Extensions.DependencyInjection (>= 1.1.1)
Package restore failed. Rolling back package changes for 'BackEnd'.
Time Elapsed: 00:00:01.4928161
========== Finished ==========
Yep it seems that it's related to "Microsoft.Extensions.DependencyInjection"
<PackageReference Include="Serilog.AspNetCore" Version="2.0.0"/>
into your .csproj and then dodotnet restore
– Set