Code Analysis (FxCop) support
I have seen in a previous discuss that Code Analysis is not supported.
This is something we use but given it an impact on build times, on one huge project we've limited it only to release builds, and therefore it was only picked up on our build server (then TeamCity).
Now that we've moved to AppVeyor for both our CI build and deployment, we pretty much never build release builds and as a result the Code Analysis issues are not being picked up.
Is this something that can be added easily?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 15 Sep, 2014 10:06 PM
Hi James,
We could provide FxCop 10.0 which is a part of Windows SDK. Would it work for you?
2 Posted by James Skimming on 16 Sep, 2014 08:37 AM
Hi Feodor, it looks like v12 is the one that bundles with VS 2013 (presumably matching the VS version)
I've not tried it from the Windows SDK version, will it still run as part build or would we need to add separate build steps for AppVeyor?
Is the reason it's not already present because its not part of the express variant of Visual Studio?
Support Staff 3 Posted by Feodor Fitsner on 18 Sep, 2014 05:14 PM
Right, FxCop 12 is part of Code Analysis tools which are the part of VS Ultimate edition.
https://visualstudio.uservoice.com/forums/121579-visual-studio/sugg...
4 Posted by gep13 on 22 Sep, 2014 12:37 PM
Fedeor, did you decide if you were going to add FxCop 10.0? Or is it already available on the Build Worker?
Thanks!
Support Staff 5 Posted by Feodor Fitsner on 22 Sep, 2014 05:03 PM
It's not yet available. Will install it today.
6 Posted by gep13 on 22 Sep, 2014 05:17 PM
Sweet! Looking forward to trying it out!
Sent from my Windows Phone
________________________________
Support Staff 7 Posted by Feodor Fitsner on 23 Sep, 2014 04:49 AM
FxCop 10.0 has been installed into:
C:\Program Files (x86)\Microsoft Fxcop 10.0
There is
FxCopCmd.exe
to run from command line.8 Posted by gep13 on 23 Sep, 2014 07:58 PM
Just wanted to confirm that I was able to get Code Analysis to run, including on a .Net 4.5 project. Turns out, Code Analysis is now included in the Express Editions of Visual Studio, so no need for an updated SDK to include it, as it is already there.
Thanks
Support Staff 9 Posted by Feodor Fitsner on 23 Sep, 2014 08:00 PM
Have you used any special syntax/build step to make it work? Or it's just VS 2013 project with code analysis on?
10 Posted by gep13 on 23 Sep, 2014 08:43 PM
Nope, nothing really special.
I added the Build.FxCop nuget package, which adds the necessary Code Analysis settings to each project. The only thing I had to do in addition to this was to create an additional Import Statement to set the output file location that I wanted.
From there, I invoked MSBuild from my psake script, and Code Analysis was then executed.
You can see the changes that I made here:
https://github.com/chocolatey/ChocolateyGUI/commit/941b83917866f189...
and the resulting build here:
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/0....
Which failed due to 226 Code Analysis violations, which I now need to fix :-)
Support Staff 11 Posted by Feodor Fitsner on 23 Sep, 2014 09:28 PM
Cool, thanks for the guide! I'll move this thread to KB section. Seamless FxCop support is great value for AV platform.
12 Posted by gep13 on 08 Oct, 2014 09:24 PM
For those that might be interested, I have just finished completing some tests which allow me to analyse the output of a Code Analysis test, and if there are any violations, report them as errors in the Tests section of the AppVeyor Build page.
If breaks down as follows:
Hopefully this will help anyone who is looking to do something similar.
You can see an example of the test errors reported here:
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/0....
NOTE: The missing line number is due to the particular CA error not actually reporting the line number where the error occured.
13 Posted by Bruno Juchli on 10 Nov, 2014 08:03 AM
you've mentioned a Build.FxCop nuget package. I couldn't find it and i think you were referring to BuildTools.FxCop: http://www.nuget.org/packages/BuildTools.FxCop/
(just in case someone else is going to look for it).
14 Posted by gep13 on 10 Nov, 2014 08:07 AM
Yes, my mistake. I was typing the nuget package name from memory, I should have looked it up. The package that you have linked to is the one that I have used.
James Skimming closed this discussion on 27 Dec, 2015 10:54 PM.