MSBUILD错误,其中文件夹包含多个解决方案文件

时间:2011-09-23 14:02:57

标签: msbuild ccnet-config

我正在尝试设置CCNET,但我遇到了问题。

我的构建失败,我收到此错误

MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.

在我的配置文件ccnet.config中,我的msbuild块如下

  <msbuild>
  <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
   <workingDirectory>C:\example\directory</workingDirectory>
  <projectFile>ExampleSolution.sln</projectFile>
  <buildArgs>/noconsolelogger /v:quiet
   /p:Configuration=Debug
   /p:ReferencePath="C:\Program Files (x86)\NUnit 2.5.10\bin\net-2.0\"
  </buildArgs>
  <targets>ReBuild</targets>
  <timeout>600</timeout>
  </msbuild>

在这种情况下,C:\ example \目录有多个解决方案文件。即使我指定了项目文件,我仍然会收到该错误。

1 个答案:

答案 0 :(得分:1)

您应该在sln组中指定要构建的内容

msbuild SlnFolders.sln /t:NotInSolutionfolder:Rebuild;NewFolder\InSolutionFolder:Clean

因此,在CC.NET中,在/t标记中添加<buildArgs>参数。

参考:http://msdn.microsoft.com/en-us/library/ms164311.aspx

相关问题