NuGet似乎永远不适合我。一旦我将代码检入源代码控制,然后尝试在另一台计算机上下载并单击Build Solution,它总是无法自动恢复NuGet包。
然后我手动按照NuGet文档https://docs.nuget.org/ndocs/consume-packages/reinstalling-and-updating-packages
上的步骤操作和https://docs.nuget.org/ndocs/consume-packages/package-restore
但是,我发现我的Package Restore似乎配置正确。
令我非常沮丧的是,当我右键单击解决方案并单击Visual Studio 2015中的还原NuGet包时,“输出”窗口不会显示NuGet在幕后执行的任何操作。我不知道它是否甚至击中了我在myget.org设置的NuGet代理。
我还能尝试什么?
这是一个示例包管理器控制台会话,当我尝试按照手动控制台驱动的步骤来修复所有内容时,NuGet完全搞砸了:
PM> Update-Package -Reinstall Antlr
Attempting to gather dependency information for multiple packages with respect to project 'AdminApi', targeting '.NETFramework,Version=v4.6.1'
Attempting to resolve dependencies for multiple packages.
Resolving actions install multiple packages
Removed package 'Antlr 3.4.1.9004' from 'packages.config'
Successfully uninstalled 'Antlr 3.4.1.9004' from AdminApi
Package 'Antlr.3.4.1.9004' already exists in folder 'd:\projects\Tools\AdminRoot\Admin\packages'
Install failed. Rolling back...
Package 'Antlr 3.4.1.9004' does not exist in project 'AdminApi'
Package 'Antlr 3.4.1.9004' already exists in folder 'd:\projects\Tools\AdminRoot\Admin\packages'
Update-Package : Failed to add reference to 'Antlr3.Runtime'.At line:1 char:1
+ Update-Package -Reinstall Antlr
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Update-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.Updat
ePackageCommand