views:

663

answers:

4

Hi, I am trying to call a batch file insdie cruisecontrol and all the batch file does it calls msbuild on a .sln C# project. I can't get this to work and I get the following error :
'msBuild' is not recognized as an internal or external command Any ideas??

Thanks

+2  A: 

Why call a batch file when you have the MSBuild task?

http://confluence.public.thoughtworks.org/display/CCNET/MsBuild+Task

Also - you may want to make sure the batch file works outside of CruiseControl.Net.

rifferte
+1  A: 

It sounds like "msbuild" isn't in your search path. Either update the "path" environment variable or specify the full path to the msbuild.exe file.

David
+2  A: 

You will have to put specify the full path to msbuild:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe

Frederik Gheysels
A: 

If it helps, here is an example of one of my msbuild tasks...

<tasks>
  <msbuild>
    <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
    <workingDirectory>D:\INETPUB\wwwroot\CruiseControl\Utilities\</workingDirectory>
    <projectFile>Utilities.csproj</projectFile>
    <timeout>900</timeout>
    <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
  </msbuild>
  <artifactcleanup   cleanUpMethod="KeepLastXBuilds"   cleanUpValue="5" />
</tasks>

This should be nested under your project node. Brandon Joyce

Brandon Joyce