Using FxCop 1.36 with CruiseControl.Net

I’ve been trying to use the lastest FxCop release with CruiseControl.Net but I couldn’t get the output to work on the CCNET page with the FxCopReport.xsl file that comes with FxCop 1.36 Beta 2. The xsl file seems to get nearly all of the build report and writes it to the screen, which makes it unusable.

I tried the xsl file that comes with CCNET and it got a little better. The first assembly would show up in the list, but all the rules kept getting indented way too far, and none of the other assemblies showed up.

The CCNET xsl seemed to be closer to being correct so I decided to use that as a starting point and began mucking with the xsl to see if I could get the transform to work correctly.

The fix turned out to be as easy as commenting out the section titled “Rule Details”. That was hiding my other assemblies as well as messing up the indentation.

You can download the xsl file that I’m using if you’re having the same issue: FxCopReport.xsl.zip

UPDATE: Turns out the change I made was dumb and removed all the good details about the rules, I did a little more work and got that back in there correctly.

13 Comments

  1. Uche Akotaobi said,

    Wrote on December 3, 2007 @ 9:50 pm

    I was having precisely the same issue you described with FxCop 1.36 and CruiseControl.NET 1.3.0.2918: I could successfully generate the FxCop report with FxCopCmd, but the report report page on the WebDashBoard refused to show anything except the first file of the first assembly.

    You fix worked for me after copying your modified FxCopReport.xsl file into my CCNET’s webdashboard/xsl and restarting IIS. Thank you so much!

    You ought to send the patch back to the upstream CCNET developers so no one else encounters this problem.

  2. Ben said,

    Wrote on December 3, 2007 @ 9:55 pm

    Uche, I’m glad to hear that it worked for you too.

  3. george said,

    Wrote on January 9, 2008 @ 3:14 pm

    Thanks for this fix, worked great.

  4. James G said,

    Wrote on February 22, 2008 @ 4:54 am

    Awesome dude, was looking through useless guide after useless guide, none of the top google listed results have working guides for the latest versions!

    Nice one.

  5. harish said,

    Wrote on March 5, 2008 @ 6:58 pm

    That was very helpful , saved tones of time mucking around the default fxcopreport xsl which comes with ccnet.

    thanks =)

  6. Daniel Hommel said,

    Wrote on March 9, 2008 @ 4:04 pm

    Ben,

    i’m a contributor to CCNET and i’d like to recommend your modified XSL file for inclusion in the 1.4 release.

    If you are interested please drop me a line.

    regards,

    Daniel

  7. Vishal Patil said,

    Wrote on July 11, 2008 @ 10:04 am

    Hi Ben,
    This xsl helped a lot to me. All the other contributions to FxCopReport so far for all the previous and current version of FxCop were not working for me. For some xsl the webdashboard of ccnet showed me the build summary and some showed me only Expan and Collapse buttons. But the xsl by you worked very well. Thanks a lot.

    Thanks onec again.
    Vishal Patil 91-9373141426, Pune, India.

  8. Barry said,

    Wrote on August 22, 2008 @ 12:38 pm

    Hi,

    Just wanted to add my thanks for this!

    Barry

  9. Trev said,

    Wrote on October 28, 2008 @ 9:34 pm

    Hi Ben,

    Thanks a lot for sharing this with everyone. It makes such a big difference. Your contribution to the community is very much appreciated!

    Trev

  10. Adel said,

    Wrote on January 23, 2009 @ 11:23 am

    Hi

    I’ve been unable to integrate FxCop report in CC build report. I’m using CC 1.4.2 with FxCop 1.36. I get what some of the guys were getting trying to use the xsl provided by FxCop-build reports were showing up in the ‘FxCop Report’ link. Then I changed it to the one provided by CC. I’m getting something different (not just the first assembly showing up) – I was seeing the page with FxCop Summary with all the metrics showing as zero and below that a blank FxCop Detail. Then I tried with the xsl provided by Ben and I was getting a totally blank page. I followed the CC document and configured all the other stuff – putting the xsl in xsl folder under webdashboard, updating dashboard.config with the path to FxCopReport.xsl and adding the path to the output xml after running FxCop in the ‘Merge’ block of ccnet.config. Can anybody help. Also if someone can email me a screenshot of what the report is supposed to look like, I’ll know what to expect.

    Thx
    Adel

  11. Adel said,

    Wrote on January 24, 2009 @ 12:13 am

    As an added note to my previous post, I’m generating the xml fxcop output from my NAnt build script in the following way.

    Looks like it is generating an html output with an xml extension. First few lines are following

    Analysis Report
    #Title {font-family: Verdana; font-size: 14pt; color: black; font-weight: bold}
    .ColumnHeader {font-family: Verdana; font-size: 8pt; background-color:white; color: black}
    .CriticalError {font-family: Verdana; font-size: 8pt; color: darkred; font-weight: bold; vertical-align: middle; }
    .Error {font-family: Verdana; font-size: 8pt; color: royalblue; font-weight: bold; vertical-align: middle; }
    .CriticalWarning {font-family: Verdana; font-size: 8pt; color: darkorange; font-weight: bold; vertical-align: middle; }
    .Warning {font-family: Verdana; font-size: 8pt; color: darkgray; font-weight: bold; vertical-align: middle; }
    .Information {font-family: Verdana; font-size: 8pt; color: black; font-weight: bold; vertical-align: middle; }

    .PropertyName {font-family: Verdana; font-size: 8pt; color: black; font-weight: bold}
    .PropertyContent {font-family: Verdana; font-size: 8pt; color: black}
    .NodeIcon { font-family: WebDings; font-size: 12pt; color: navy; padding-right: 5;}
    .MessagesIcon { font-family: WebDings; font-size: 12pt; color: red;}
    .RuleDetails { padding-top: 10;}
    .SourceCode { background-color:#DDDDFF; }
    .RuleBlock { background-color:#EEEEFF; }
    .MessageNumber { font-family: Verdana; font-size: 10pt; color: darkred; }
    .MessageBlock { font-family: Verdana; font-size: 10pt; color: darkred; }
    .Resolution {font-family: Verdana; font-size: 8pt; color: black; }
    .NodeLine { font-family: Verdana; font-size: 9pt;}
    .Note { font-family: Verdana; font-size: 9pt; color:black; background-color: #DDDDFF; }
    .NoteUser { font-family: Verdana; font-size: 9pt; font-weight: bold; }
    .NoteTime { font-family: Verdana; font-size: 8pt; font-style: italic; }
    .Button { font-family: Verdana; font-size: 9pt; color: blue; background-color: #EEEEEE; border-style: outset;}
    a:link { color: blue; text-decoration: none; }
    a:visited { color: blue; text-decoration: none; }
    a:active { color: blue; text-decoration: none; }

    function ViewState(blockId)
    {
    var block = document.getElementById(blockId);
    if (block.style.display==’none’)
    {
    block.style.display=’block’;
    if (block.className == ‘MessageDiv’)

    notice the html starting tag.

    Is anybody else experiencing this. Is there a way to tell FxCop not to generate the html file. I’m thinking this could be the reason why my page is not showing up right.

  12. Adel said,

    Wrote on January 24, 2009 @ 12:19 am

    Sorry my post didn’t come out right. NAnt block is following

    also it missed the first few lines of the xml

    Analysis Report
    #Title {font-family: Verdana; font-size: 14pt; color: black; font-weight: bold}
    .ColumnHeader {font-family: Verdana; font-size: 8pt; background-color:white; color: black}
    .CriticalError {font-family: Verdana; font-size: 8pt; color: darkred; font-weight: bold; vertical-align: middle; }
    .Error {font-family: Verdana; font-size: 8pt; color: royalblue; font-weight: bold; vertical-align: middle; }
    .CriticalWarning {font-family: Verdana; font-size: 8pt; color: darkorange; font-weight: bold; vertical-align: middle; }
    .Warning {font-family: Verdana; font-size: 8pt; color: darkgray; font-weight: bold; vertical-align: middle; }
    .Information {font-family: Verdana; font-size: 8pt; color: black; font-weight: bold; vertical-align: middle; }

    .PropertyName {font-family: Verdana; font-size: 8pt; color: black; font-weight: bold}
    .PropertyContent {font-family: Verdana; font-size: 8pt; color: black}
    .NodeIcon { font-family: WebDings; font-size: 12pt; color: navy; padding-right: 5;}
    .MessagesIcon { font-family: WebDings; font-size: 12pt; color: red;}
    .RuleDetails { padding-top: 10;}
    .SourceCode { background-color:#DDDDFF; }
    .RuleBlock { background-color:#EEEEFF; }
    .MessageNumber { font-family: Verdana; font-size: 10pt; color: darkred; }
    .MessageBlock { font-family: Verdana; font-size: 10pt; color: darkred; }
    .Resolution {font-family: Verdana; font-size: 8pt; color: black; }
    .NodeLine { font-family: Verdana; font-size: 9pt;}
    .Note { font-family: Verdana; font-size: 9pt; color:black; background-color: #DDDDFF; }
    .NoteUser { font-family: Verdana; font-size: 9pt; font-weight: bold; }
    .NoteTime { font-family: Verdana; font-size: 8pt; font-style: italic; }
    .Button { font-family: Verdana; font-size: 9pt; color: blue; background-color: #EEEEEE; border-style: outset;}
    a:link { color: blue; text-decoration: none; }
    a:visited { color: blue; text-decoration: none; }
    a:active { color: blue; text-decoration: none; }

  13. Adel said,

    Wrote on January 24, 2009 @ 12:20 am

    Sorry for some reason, its not showing some stuff. I can email it

Comment RSS