MSBUILD error where folder contains more than one solution file

纵然是瞬间 提交于 2021-01-27 05:09:33

问题


I'm trying to set up CCNET and I've run into a problem.

My builds are failing and I'm getting this error

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

In my configuration file ccnet.config my msbuild block is as follows

  <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>

In this case, C:\example\directory has multiple solution files. Even though I specified the project file I'm still getting that error.


回答1:


You should specify what to build in the sln group.

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

So in CC.NET, add the /t parameter in the <buildArgs> tag.

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



来源:https://stackoverflow.com/questions/7530203/msbuild-error-where-folder-contains-more-than-one-solution-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!