Click here to Skip to main content
Click here to Skip to main content

Set up the Web Dashboard of CCNet to Display the Compiler Error of MSBuild Files

, 7 Apr 2010
Rate this:
Please Sign up or sign in to vote.
This tutorial will explain how to set up the CCNet to display the compiler error of the MSBuild

Introduction

In this tutorial, I will explain how to setup the web dashboard to display the MSBuild errors.

Background

In the previous article, I have explained how to setup the MSbuild file and CCNet for the automated build of project. In this part, I will explain about configuring the web dashboard of ccnet to display the msbuild error.

Using the Code

By default, the web dashboard of ccnet displays the result of build without exact error messages. To display the error in web dashboard, go to “C:\Program Files\CruiseControl.NET\webdashboard” and open file dashboard.config.

There, you will find the below code:

<buildReportBuildPlugin>
	<xslFileNames>
		<xslFile>xsl\header.xsl</xslFile>
		<xslFile>xsl\modifications.xsl</xslFile>
		<xslFile>xsl\unittests.xsl</xslFile>
		<xslFile>xsl\MsTestSummary.xsl</xslFile>
		<xslFile>xsl\fxcop-summary.xsl</xslFile>
		<xslFile>xsl\NCoverSummary.xsl</xslFile>
		<xslFile>xsl\SimianSummary.xsl</xslFile>
		<xslFile>xsl\fitnesse.xsl</xslFile>
	</xslFileNames>
</buildReportBuildPlugin>

Now add this line in the above code:

<xslFile>xsl\compile-msbuild.xsl</xslFile> 

Therefore the code will become:

<buildReportBuildPlugin>
	<xslFileNames>
		<xslFile>xsl\header.xsl</xslFile>
		<xslFile>xsl\modifications.xsl</xslFile>
		<xslFile>xsl\compile-msbuild.xsl</xslFile>
		<xslFile>xsl\unittests.xsl</xslFile>
		<xslFile>xsl\MsTestSummary.xsl</xslFile>
		<xslFile>xsl\fxcop-summary.xsl</xslFile>
		<xslFile>xsl\NCoverSummary.xsl</xslFile>
		<xslFile>xsl\SimianSummary.xsl</xslFile>
		<xslFile>xsl\fitnesse.xsl</xslFile>
	</xslFileNames>
</buildReportBuildPlugin> 

and we have done it.

1.JPG

Points of Interest

There are lots of XSL files available in web dashboard folder of ccnet. We can tweak it as per our requirements.

Sending Email to the Group of User on Build Fail

We can also send the email to the user groups if the build fails.

<workingDirectory>D:\Projects\TheWorks\Applications\ProjectFolder</workingDirectory>
       <buildArgs>ProjectName.msbuild /p:Configuration=Debug</buildArgs>
		<timeout>1800</timeout>
		<!--  30 minutes -->
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll
</logger>
		</msbuild>
		</tasks>
		<publishers>
			<statistics />
			<xmllogger />
			<email from="EMAIL ADDRESS" mailhost="HOSTNAME" 
			mailhostPassword="PASSWORD" mailhostUsername="USERNAME" 
			includeDetails="true">
				<users>
				<user name="Jitendra Zaa" 
					address=ilovenagpur@gmail.com 
					group="AdminGroup" />
					<user name="Santosh Karemore" 
					address=santosh.karemore@gmail.com 
					group="AdminGroup" />
					<user name="Manoranjan sahoo"
					address=manoranjan.sahoo@gmail.com 
					group="AdminGroup" />
					<user name="Minal Shirsikar" 
					address="admin@shivasoft.in" group="Emul" />
				</users>
				<groups>
					<group name="Emul" notification="failed" />
					<group name="AdminGroup" 
						notification="failed" />
				</groups>
			</email>
		</publishers>
	</project>  

The tags are self explanatory.

There may be following types of notification:

  • Failed
  • Fixed
  • Always

We can create as many groups as we want and to every group, we can specify the notification type.

Note

It is very important to write statistics and xmllogger in configuration file, otherwise it will give an error in web dashboard.

Change Format of Email Sent

By default, email sent by CCnet does not include the reason of errors. We can change the format of email sent.

Open “ccnet.exe.config” and “ccservice.exe.config” file:

And change the below line to get errors in email.

<!-- Specifies the stylesheets that are used to 
transform the build results when using the EmailPublisher -->
	<xslFiles>
		<file name="xsl\header.xsl"/>
		<file name="xsl\compile.xsl"/>
                <file name="xsl\compile-msbuild.xsl"/>
		<file name="xsl\unittests.xsl"/>
		<file name="xsl\fit.xsl"/>
		<file name="xsl\modifications.xsl"/>
		<file name="xsl\fxcop-summary.xsl"/>
	</xslFiles> 

Below are the list of XSL files and their working:

Transform Name Description
header Summary information for a build, including whether it passed or failed
compile Displays any errors or warnings encountered during compiling .NET projects
unittests Shows summary information for any NUnit or JUnit output encountered in the build log
modifications Shows any changes to sourcecontrol that were first encountered in this build
fxcop-summary Summary information for any FxCop output encountered. Works for output generated by FxCop 1.312
fit Prints summary information for any Fit output encountered in the build log
tests Detailed NUnit Report
AlternativeNUnitDetails An Alternative NUnit Report
timing Detailed NUnit Timing Report
Nant Shows any NAnt output as it would have appeared in a console window
FxCopReport Detailed information for any FxCop output encountered. Works for output generated by FxCop 1.312. See here for more details.
NCover Report for NCover output. Works for NCover.Org version of NCover. See here for more details.
vil Report for Vil Metrics. See here for more details.
msbuild.xsl Detailed build report when using MSBuild
compile-msbuild.xsl Displays any errors or warnings encountered during compiling .NET projects when using MSBuild

History

  • 7th April, 2010: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Jitendra Zaa
Software Developer (Senior) GlobalLogic
India India
From a Nagpur City of Maharashtra currently working as Sr. Software Engineer at GlobalLogic India pvt. Limited.
He has nearly 3 years experience and worked in many technologies like JAVA, PHP, JSP, Struts, Hibernate.
Currently working on .Net technology with C#, ASP and telerik controls.
Also has experience in cloud computing including salesforce.com.
you can reach him at ilovenagpur@gmail.com
Blog:http://www.shivasoft.in/blog

Comments and Discussions

 
GeneralMy vote of 5 PinmemberGlenConway21-Oct-10 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 7 Apr 2010
Article Copyright 2010 by Jitendra Zaa
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid