Problems viewing FxCop artifact through TeamCity

I have a build that uses the MSBuild build runner. In the build file I have a section that executes an FXCop test:

]]>

I then specify "ExampleProject.FxCop.xml" in the artifact path. If I open the XML file in the output folder or in the build server folder's artifact folder through windows the file opens up correctly. If I open it through TeamCity I get this error:

"
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


-



Access is denied. Error processing resource 'file:///c:/program files/microsoft fxcop 1.36/Xml/FxCopReport.xsl'.

"

Can anyone offer any help? Is there a better way to integrate FxCop results?

4 comments

Hello,

It seems this XML file contains full path to XSLT: file:///c:/program
files/microsoft fxcop 1.36/Xml/FxCopReport.xsl. You probably should
configure FxCop to produce XML file with relative path to XSLT and publish
this XSLT to TeamCity as build artifact.

--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"Kevin" <no_reply@jetbrains.com> wrote in message
news:18052661.1204206322226.JavaMail.itn@is.intellij.net...
>I have a build that uses the MSBuild build runner. In the build file I have
>a section that executes an FXCop test:
>

<Exec Command="FxCopCmd.exe /project:%22C:\FxCop\model.FxCop%22
/out:%22C:\Team City CI\ExampleProject\ExampleProject.FxCop.xml%22"
WorkingDirectory="C:\Program Files\Microsoft FxCop 1.36" />

>

I then specify "ExampleProject.FxCop.xml" in the artifact path. If I open
the XML file in the output folder or in the build server folder's artifact
folder through windows the file opens up correctly. If I open it through
TeamCity I get this error:

>

"
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.

>
>

--------------------------------------------------------------------------------

>

Access is denied. Error processing resource 'file:///c:/program
files/microsoft fxcop 1.36/Xml/FxCopReport.xsl'.

>

"

>

Can anyone offer any help? Is there a better way to integrate FxCop
results?



0

Yeah If I remove the line

<?xml-stylesheet type="text/xsl" href="c:\program files\microsoft fxcop 1.36\Xml\FxCopReport.xsl"?>

from the xml file produced I can open it from TC, but as far as I can tell there's no way to customize what comes out in the XML file automatically from the command line in FxCop. Is there a preferred way to integrate the results with TC?

0

You can use option /oxsl:filewiththexsltoapply and option /axsl to apply the style sheet. The only problem I see with this is that the default stylesheet that comes with FXCop 1.36 doesn't expand the items by default, and when the resulting page is seen in TeamCity, scroll bars appears as soon as you expand an item.

0

Hi,

Here's the nant task in full that will allow you to get around the XML error:

]]>

The attached XSL will allow you to include a summary of different levels of errors / warnings in your code without breaking the build

Dan



Attachment(s):
FxCopSummary.xsl
0

Please sign in to leave a comment.