问题
We have setup Cruise Control.Net to build .Net projects from source control. Problem is that when the build fails the error log shows a huge build xml and we struggle to find out the actual error. How to configure Cruise Control to show error in more readable format?
回答1:
Make sure that a xmllogger is included in your ccnet configuration and try viewing the build results via ccnet's web dashboard.
See example of failed build output.
回答2:
To make it even more readable (bring the project name along with the error)
in webdashboard/xsl/msbuild.xsl
add
<xsl:if test="parent::target/@name != ''">
target-><xsl:value-of select="parent::target/@name" /> 
</xsl:if>
just above
<xsl:if test="@file != ''" >
in the <xsl:template match="error">
section.
so as a whole msbuild.xsl section would be
<xsl:template match="error">
<div style="color:orangered">
<xsl:value-of select="./../../@file" /> 
<xsl:if test="parent::target/@name != ''">
target-><xsl:value-of select="parent::target/@name" /> 
</xsl:if>
<xsl:if test="@file != ''" >
<xsl:value-of select="@file"/> (<xsl:value-of select="@line"/>,<xsl:value-of select="@column"/>): 
</xsl:if>
error <xsl:value-of select="@code"/>: <xsl:value-of select="text()" />
</div>
</xsl:template>
来源:https://stackoverflow.com/questions/3422568/how-to-configure-cruise-control-net-to-show-proper-error-in-web-dashboard