Click here to Skip to main content
15,860,972 members
Articles / .NET

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

Rate me:
Please Sign up or sign in to vote.
4.82/5 (11 votes)
7 Apr 2010CPOL2 min read 30.6K   17   1
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:

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

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

Therefore the code will become:

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

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

XML
<!-- 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)


Written By
Software Developer (Senior) Cognizant Technology Solutions
India India
Having more than 9 years of experience in Programming and web application development.

Writing technical blog articles, learning new Programming languages , frameworks and sharing knowledge with others is one of my hobby. The more I learn, more I understood that how little I know and that drives me to dig into technology and languages to explore.

From last few years now, working on Salesforce platform and providing customer solutions using force.com as an Architect and Technical Lead Role. I have worked on many area of Salesforce like force.com, Heroku, PHP Toolkit, Partner Webservices, Metadata and Enterprise webservices, Tooling API, Customer Portal, Partner Portal, Community, Salesforce1 etc...

Blog:http://www.jitendrazaa.com/blog

Comments and Discussions

 
GeneralMy vote of 5 Pin
GlenConway21-Oct-10 3:57
GlenConway21-Oct-10 3:57 
Thanks, it's always annoyed me that this information was missing after upgrading to 1.5.

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

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