【发布时间】:2019-08-05 11:36:30
【问题描述】:
我有一个在 TeamCity 上运行的夜间进程,它将在本地托管的 NuGet repo 上循环遍历我的包,并将所有解决方案中的所有包更新为最新的 prerelease version。
当我在第二天早上提取最新代码时。解决方案构建良好,但未加载我的项目引用。
未解决的项目引用: https://imgur.com/a/v7Klbkm
未解决的代码: https://imgur.com/a/EEzWgUe
我正在使用packages.config 来管理我的 NuGet 包。
为了继续工作,我必须通过手动询问缺失引用的属性或更改.csproj 文件中的某些内容来“重新加载”我的Visual Studio 项目。
这是我的小解决方法,但对于一些有 10 多个项目的解决方案,这变得相当麻烦。
其他更新包的方法工作正常,如果我尝试通过 Visual Studio 更新包,我没有问题。只有在使用 NuGet.exe 命令行实用程序时才会失败。
这是我们在夜间构建期间通过NuGet.exe 上的TeamCity 更新软件包的命令:
NuGet.exe update <path_to_packages.config> -Id <current_package_to_update> -pre -NonInteractive
这是我们正在使用的 NuGet 版本:
NuGet Version: 4.8.1.5435
这是日志的摘录:
found PFW.Utilities with version 2019.9.0-build0009 in file C:\Sources\Xmp\ModXmp\packages.config
http://srvppratonexus.prato.be:8888/nexus/service/rest/repository/browse/nuget-prato-prereleases/PFW.Utilities/2019.9.0-build0009
MSBuild auto-detection: using msbuild version '16.1.76.45076' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin'.
使用的 Feed:
http://srvppratonexus:8888/nexus/service/local/nuget/nuget-group/
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Attempting to gather dependency information for multiple packages with respect to project `C:\Sources\Xmp\ModXmp\ModXmp.csproj`, targeting `.NETFramework,Version=v4.6.1`
Gathering dependency information took 10.79 sec
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Found package 'PFW.Utilities 2019.9.0-build0019' in 'C:\Sources\Xmp\packages'.
Removed package 'PFW.Utilities 2019.9.0-build0009' from 'packages.config'
Successfully uninstalled 'PFW.Utilities 2019.9.0-build0009' from ModXmp
Package 'PFW.Utilities.2019.9.0-build0019' already exists in folder 'C:\Sources\Xmp\packages'
Added package 'PFW.Utilities.2019.9.0-build0019' to 'packages.config'
Successfully installed 'PFW.Utilities 2019.9.0-build0019' to ModXmp
Executing nuget actions took 192.26 ms
【问题讨论】:
标签: visual-studio nuget