程序包还原失败.回滚软件包更改-Serilog.AspNetCore [英] Package restore failed. Rolling back package changes - Serilog.AspNetCore

查看:568
本文介绍了程序包还原失败.回滚软件包更改-Serilog.AspNetCore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net Core项目,正在尝试向其中添加一个记录器. 我选择在其他项目中使用的SeriLog.

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.

但是当我尝试添加" Serilog.AspNetCore "软件包版本2.0.0时,我得到了"

But when I'm trying to add the "Serilog.AspNetCore" package version 2.0.0 I'm getting"

打包还原失败.回滚"BackEnd"的软件包更改.

Package restore failed. Rolling back package changes for 'BackEnd'.

我的csproj包含以下设置:

My csproj contain the following settings:

<PropertyGroup>
   <TargetFramework>netcoreapp2.0</TargetFramework>
   <DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
   <AssemblyName>BackEnd</AssemblyName>
  <RootNamespace>BackEnd</RootNamespace>
</PropertyGroup>

Allready已尝试清除所有nuget缓存,进行重建,然后重新启动VS

Allready tried to clear all nuget cache, rebuilding, restart VS

在Win10,Visual Studio 2017 15.3.0上运行

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?

*更新-详细的构建日志(感谢@ Leo-MSFT):

*Update - the detailed build log (Thanks @Leo-MSFT for that):

...

...

使用.NETCoreApp,Version = v2.0检查System.Security.Cryptography.Csp 4.3.0的兼容性.

Checking compatibility for System.Security.Cryptography.Csp 4.3.0 with .NETCoreApp,Version=v2.0.

使用.NETCoreApp,Version = v2.0检查runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0的兼容性.

Checking compatibility for runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 with .NETCoreApp,Version=v2.0.

所有软件包和项目都与.NETCoreApp,Version = v2.0兼容.

All packages and projects are compatible with .NETCoreApp,Version=v2.0.

检测到的程序包降级:Microsoft.Extensions.DependencyInjection从2.0.0降到1.1.1.直接从项目中引用该软件包以选择其他版本.

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.

后端(> = 1.0.0)-> Serilog.AspNetCore(> = 2.0.0)-> Microsoft.Extensions.DependencyInjection(> = 2.0.0)

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)

BackEnd (>= 1.0.0) -> Microsoft.Extensions.DependencyInjection (>= 1.1.1)

打包还原失败.回滚"BackEnd"的软件包更改.

Package restore failed. Rolling back package changes for 'BackEnd'.

已用时间:00:00:01.4928161

Time Elapsed: 00:00:01.4928161

===========完成=========

========== Finished ==========

是的,它似乎与" Microsoft.Extensions.DependencyInjection "

推荐答案

通过将所有现有的Nuget软件包更新为可用的最新版本来解决. 包括这5个软件包:

Solved by updating all my existence Nuget packages to the latest version available. Including those 5 packages:

<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />

问题是"Microsoft.Extensions.DependencyInjection" 的版本,但是我更新了所有这些.

The problem was the version of "Microsoft.Extensions.DependencyInjection" but I update all of them.

这篇关于程序包还原失败.回滚软件包更改-Serilog.AspNetCore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆