Get CruiseControl descriptive errors - c#-4.0

My cruisecontrol runs two nant scripts and it builds by using msbuild. Msbuild is failing without giving any errors. Is there any way to get more error details? Below is how I have configured publishers.
<publishers>
<email from="cruise#xx..com.au" mailhost="stat-server" includeDetails="TRUE">
<users>
....
</users>

I can view the CruiseControl.net Build log through the web application "View Build Log" link. It gives all the details of the build process.

I normally start of running the build scripts from the command line on your build server.
You can also run MSBuild with a verbosity switch, that increase the amount of debug information. That will at least give you a idea of where the problem lies, perhaps your cruise control server is fine.
msbuild.exe <buildFile.msbuild> /v:d

Related

Visual Studio 2012 Command Line Building - Detecting Build Failures

I'm setting up a build server for a Visual Studio 2012 project and I'm trying to add detection for failed builds so the server can properly recover after a build failure and notify users of the failure and the error message.
I'm using devenv.exe with the "/Build" and "/Out" switches, however for building, the "/Out" switch captures all build output and stores in the specified file, and I only want it to capture build errors.
Does anyone have any suggestions on how I can only have build errors written to the file, or better ways of detecting a build failure?
Thank you in advance!
If you just need a pass/fail, you could use ERRORLEVEL in a batch/cmd script. It's primitive, but would probably work for most cases. Something like this:
#devenv Solution.sln /Build
#if ERRORLEVEL 1 echo Build Failed
You could also use MSBuild, which has options for console output (i.e. /clp:ErrorsOnly) as well as file output. Something like this:
msbuild /p:Configuration=Debug /t:Rebuild /clp:ErrorsOnly Solution.sln

nant hanging when run in cygwin

I updated to cygwin 1.7.15 this afternoon and went to run the same nant script I ran successfully this morning, except that nant now hangs - no output is ever shown. I've verified nant (0.91.3881.0 alpha2) still runs in a windows cmd prompt and I've tried to rebaseall on cygwin without any luck.
Edit: In 1.7.15, nant doesn't show as a process in task manager nor Process Explorer (sysinternals).
How do I get nant back working in cygwin?
It looks like this is a known bug with a fix coming. There doesn't appear to be an ETA on the fix. You can work around it by reverting to Cygwin 1.7.14. Redirecting stderr and stdout doesn't work.
If you use "non-cygwin dlls" make sure you set the CYGWIN environment variable to pipe_byte (see here for more info).

VsPerfMon.exe and VsTestHost.exe Processes Hang when Run by MSTest from CruiseControl.NET

I'm using CruiseControl.NET with MSTest to build my vs2008 project and run my unit tests.
If I run the tests from Visual Studio 2008, they work perfectly. However, when the tests are started by CruiseControl, the VsPerfMon.exe and VsTestHost.exe processes hang until i end them from the taskmanager. This means that cruisecontrol itself hangs also and i never get a result for my build in cruisecontrol.
Does anybody have any idea what might be the solution to my problem?
Thanks,
D
This sounds like they may be waiting for user input? - You could try running the msbuild task (or NAnt if thats what you use) on the server yourself to check
Also check what user account the CruiseControl.Net service is running as and maybe switch it to your user account and see if that changes it - that way you would know if its related to account permissions etc
check this http://social.msdn.microsoft.com/Forums/pl-PL/tfsbuild/thread/af706a24-d47a-4a90-b3e6-beb5691f3aa0
have not tested yet...
Possible solution would be to add a AfterCompile target to kill the VSPerfCmd before the tests run.
<Target Name="AfterCompile">
<Message Text ="Shutdown the vsperfmon" />
<Exec Command='"C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Performance Tools\VSPerfCmd.exe" /shutdown' ContinueOnError="true" />
</Target>

Using PSExec from within CruiseControl .NET

I'm trying to call a PSExec task from CC.NET and running into some difficulties.
Here's the CC project
<project name="Test">
<tasks>
<exec>
<executable>C:\Utilities\psexec.exe</executable>
<buildArgs>-u [UNAME] -p [PWD] "C:\Utilities\Joel.bat"</buildArgs>
</exec>
</tasks>
</project>
Here's the source of Joel.bat
CLS
#ECHO OFF
What happens is that the first time I force the project to build, it runs successfully. The PSExec task is kicked off and the Joel.bat file is executed. I get some information in the build log about exit codes, but the task is successful.
Here's the build log output.
PsExec v1.97 - Execute processes remotely
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com
C:\Utilities\Joel.bat exited with error code 0.
The second time I force the build I get the dreaded "The Application failed to initialize properly (0xc0000142)" error message. I can't ever run the build more than once
More so, if I try to shut down the cruise control .net service from within the services MSC, it can't. It's like there's a lock somewhere that is taken and not released. The only way I can kill the service is by killing the ccservices.exe process.
I've tried the exact same thing using an nant task and gotten the exact same results. It works the first time, and fails the second and I can't shutdown the process.
I'm not sure if this is an issue with CC.NET or with PSEXEC (or me of course).
Anybody got any ideas? I'm posting to the CC.NET forums as well.
I'm using the latest and greatest of PSExec and 1.4.4 of CC.NET.
Thx, Joel
Run CruiseControl service under administrator account
Have you tried any other psexec options?
-d Don't wait for application to terminate. Only use this option for non-interactive applications.
maybe its the old eula problem, try the /accepteula option for psexec

CruiseControl.Net and NAnt Build Problem

I'm configuring a CruiseControl.net server for the first time. My team already uses NAnt build scripts, so we are just pointing the server at the scripts and letting NAnt do all the work.
As you can see, it's pretty simple:
<project name="ChannelIP">
<tasks>
<nant>
<executable>C:\Program Files\nant-0.86-beta1\bin\nant.exe</executable>
<baseDirectory>D:\mypath</baseDirectory>
<buildFile>D:\mypath\myNAnt.build</buildFile>
<targetList>
<target>build</target>
</targetList>
</nant>
</tasks>
</project>
The problem is that when I run it under CC, I get the following error:
Function call failed.
Expression:
${framework::get-framework-directory('net-3.5')}/msbuild.exe
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Microsoft .NET Framework 3.5 (net-3.5)
is not installed, or not correctly
configured. Object reference not set
to an instance of an object.
I do, in fact, use the ${framework::get-framework-directory('net-3.5')} variable to get the path to msbuild.exe; however, this code has never failed before. I can even RDP into the server using the user account that CC is running under and run the NAnt build file directly and it works just fine.
Why is it that this otherwise fine file fails just when CC runs it.
NOTE
-CC is running on the same machine that I normally run the build scripts from
The CC service is probably not running under an account with appropriate permissions. Have you tried running CC using the command line (which will run as the logged on user) to see if you have the same problem?
This sounds like a NAnt problem, there were some issues with it and .NET 3.5. Which version of NAnt are you using?
Also, have you seen Using 0.86 beta 1 for .NET 3.5? The guy has the same error message thrown by NAnt. The suggested solution was to use the latest nightly build.

Resources