【发布时间】:2014-04-30 14:39:40
【问题描述】:
Windows 2012 R2 构建服务器、TeamCity 8.1.2、nuget.exe 2.8.1
在启用并测试涉及常规完整构建清理和 NuGet 还原的构建配置后,我们启用了增量 VCS 更新,并在我们的构建配置上启用了 NuGet 更新。在 NuGet 更新期间,构建配置现在失败并出现此错误:
[Step 1/4] update: Updating NuGet packages for OurSolutionName.sln
[22:20:10]NuGet command: D:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe update D:\TeamCity\buildAgent\work\52034b1c4c1ab5f5\OurSolutionName.sln -Verbose -RepositoryPath D:\TeamCity\buildAgent\work\52034b1c4c1ab5f5\packages
[22:20:10]Starting: D:\TeamCity\buildAgent\temp\agentTmp\custom_script9174264003705363137.cmd
[22:20:10]in directory: D:\TeamCity\buildAgent\work\52034b1c4c1ab5f5
[22:20:10]Scanning for projects...
[22:20:10]The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TypeScript\Microsoft.TypeScript.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\TeamCity\buildAgent\work\52034b1c4c1ab5f5\proofs\MvcRouting\MvcRouting\MvcRouting.csproj
[22:20:11]Process exited with code 1
[22:20:11][Step 1/4] Step Update nuGet packages (NuGet Installer) failed
关键是 MSBuild 路径中的 \v10.0\。我查看了错误中提到的 csproj 文件,它使用标准兼容性逻辑来确定 Visual Studio 版本并适当地设置路径,如果 VisualStudioVersion 为空,则仅回退到 10.0。我检查了解决方案文件,并确认 VisualStudioVersion 为 12:
Microsoft Visual Studio Solution File, Format Version 12.00
Visual Studio 2013
VisualStudioVersion = 12.0.30110.0
任何想法为什么 NuGet 更新似乎没有选择正确的 Visual Studio 版本?
【问题讨论】:
标签: c# msbuild visual-studio-2013 nuget