Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBUILD error where folder contains more than one solution file

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.

like image 872
pfista Avatar asked Sep 23 '11 14:09

pfista


1 Answers

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

like image 106
TridenT Avatar answered Oct 12 '22 20:10

TridenT