【发布时间】:2011-05-15 01:52:03
【问题描述】:
早安
我正在运行 Hudson java -jar hudson.war,并将 MSBuild 配置为 described here。似乎 MSBuild 不起作用。
我认为这与 .csproj 文件中包含的默认值有关:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
这条路径具有误导性,会将 Hudson 带到 C:\Microsoft.CSharp.targets,而不是应有的 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.CSharp.targets。
我尝试使用此完整路径信息对 csproj 文件进行硬编码,但它也会引发异常,告知存在无效字符。
也许我使用了错误的 MSBuild.exe 版本?
这是在 csproj 中使用默认 $(MSBuildToolsPath) 变量时的 Hudson 消息:
控制台输出
Started by user anonymous
Updating http://svn.mycoolserver.org/svn/repository/projects/trunk/MyCoolClassLibrary
U MyCoolClassLibrary.csproj
At revision 36706
Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe
Executing command: cmd.exe /C C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe /p:Configuration=Release MyCoolClassLibrary.csproj && exit %%ERRORLEVEL%%
[workspace] $ cmd.exe /C C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe /p:Configuration=Release MyCoolClassLibrary.csproj && exit %%ERRORLEVEL%%
Microsoft (R) Build Engine Version 2.0.50727.3053
[Microsoft .NET Framework, Version 2.0.50727.3615]
Copyright (C) Microsoft Corporation 2005. All rights reserved.
C:\Documents and Settings\myUser\.hudson\jobs\MyCoolClassLibrary\workspace\MyCoolClassLibrary.csproj(63,11): error MSB4019: The imported project "C:\Microsoft.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Finished: FAILURE
【问题讨论】:
标签: msbuild continuous-integration hudson