的版本運行此命令的NuGet無法找到包
nuget.exe restore .\MySolution.sln
給出了這樣的錯誤:
Unable to find version '1.0.0' of package 'Microsoft.Net.Compilers'.
所在的包以前已安裝並恢復
,但莫名其妙地成爲腐敗。
的版本運行此命令的NuGet無法找到包
nuget.exe restore .\MySolution.sln
給出了這樣的錯誤:
Unable to find version '1.0.0' of package 'Microsoft.Net.Compilers'.
所在的包以前已安裝並恢復
,但莫名其妙地成爲腐敗。
原來只需通過
nuget.exe update -self
更新的NuGet版本更新2.8.0從3.4.4到足夠大,而且包現在恢復正常。
我有同樣的問題,但我需要繼續使用nuget.exe
2.8,因爲無法升級安裝在我們的構建服務器上的.NET Framework版本(2.8是仍然適用於.NET 4.0的最新版本) 。
原因竟然是nuget.config
只指向v3 API。解決方案是添加到v2 API中。例如。
<configuration>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="nuget v2" value="https://www.nuget.org/api/v2" />
</packageSources>
</configuration>
在我們的例子中,我們評級從3.3.x在VS中的NuGet擴展到3.4.4。
您可以在工具菜單 - >擴展和更新 - >更新 - > Visual Studio庫中找到更新。
我使用的是自動化的Mac版本,就像你不能升級'nuget'一樣修復了我的錯誤。謝謝! – user1