Nuget package installation failed in VS 2017 (.net core)

时间:2017-08-14 07:05:43

标签: .net asp.net-core .net-core console-application nuget-package

I created new Console App(.NET Core) and i am trying to add package with NuGet the package is : Microsoft.Extensions.Configuration When I click install I get this message:

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

1 个答案:

答案 0 :(得分:1)

我很高兴您的问题得到了解决,但我相信您找到的解决方案可能是巧合,因为Microsoft.Extensions.Configuration与Microsoft.ApplicationInsights.AspNetCore没有依赖关系,但Microsoft.ApplicationInsights.AspNetCore确实依赖于Microsoft。 Extensions.Configuration v1.0.0

昨天我遇到了类似的问题,当天许多Microsoft .net Core v2.0.0 NuGet软件包被推送到NuGet。我无意中尝试将v2.0.0 NuGet包添加到我的.net Core v1.x应用程序中,这给出了错误

  

恢复C:\ Users \ MrSlim_Is_Awesome \ documents \ visual studio 2017 \ Projects \ WebApplication4 \ WebApplication4 \ WebApplication4.csproj ...   软件包Microsoft.Extensions.Configuration 2.0.0与netcoreapp1.1(.NETCoreApp,Version = v1.1)不兼容。包Microsoft.Extensions.Configuration 2.0.0支持:netstandard2.0(.NETStandard,Version = v2.0)   包恢复失败。回滚“WebApplication4”的包更改。   经过的时间:00:00:02.1768927   ==========完成==========

解决方案是选择相关Microsoft NuGet软件包的v1.x.x版本。