fxcop

Is there CI server software that can do all of this?

I'm trying to put together a Continuous Integration server that will do the following: Work with subversion Use NUnit tests (fail build on failed tests) Use partcover (fail build on < X% coverage) Run code against FxCop (fail build on FxCop warnings, given settings) Run code against StyleCop (fail build on StyleCop warnings, given sett...

Creating a readable FxCop report

Is there a good tool that can convert the XML output of FxCop into something that can be put into a Word document? I'd prefer not to write an XML-FO XSLT transform, maybe someone did something like that already. ...

Error: Cannot find .net assembly during FxCop analysis

I'm running FxCop from MSBuild and during the analysis it throws an error stating that it could not find the System.XML assembly and that I need to specify the location using the /directory parameter, which I then did but it didn't work. Any idea what I should do? I am running it on projects built on .Net 4.0 ...

Mark assembly App_licenses.dll with AssemblyVersion (FxCop CA1016 rule)

Hello everyone, I'm trying to fulfil FxCop's rules in my web site. Since I use some Infragistics controls I have a licenses.licx file that turns into a "app_licenses.dll" assembly after publication. The problem is that this app_licenses.dll assembly does not comply with rule CA1016 (MarkAssembliesWithAssemblyVersion), and I should add a...

Should we start using FxCop and/or StyleCop in a mature project?

We have 3 years old solution (.sln) with about 20 projects (.csproj). It is reasonable to start using FxCop and/or StyleCop? Maybe we should use it for several small projects first but not for whole solution? It would be good to see some experienced answers. Thanks. EDIT: We are using TeamCity for continuous integration. And we have n...

VS2010 Custom Code Analysis Rule

I'm trying to write a custom fxcop rule for mstest projects VS2010. I'd like to debug it but keep getting an exception when it tries to load the dll for the mstest project it fails stating that it can't find referenced assembly: Microsoft.FxCop.Common.AssemblyLoadException Could not load C:\Users\Administrator\Documents\Visu...

Where is the Code Analysis (FxCop) function in VS2008?

I've read that FxCop is integrated in to Visual Studio 2008 out of the box as "Code Analysis". I can't find how to run the analysis though. Where is the "Run Code Analysis" function? ...

Using FxCop to analyse only the latest changes

I am trying to get FxCop to work in a way that it analyses only the incremental changes in the exe/dll that it analyses and not the entire thing as it has anlaysed that part already.... any thoughts how one could achieve this?? ... thanks in advance... Regards, ASV... ...

fxcop with Nant

hi all, How to merge/integrate "fxcop" with Nant script...in my solution i have many projects with lots of dll's this is my sample code: (target name="runFxCop" exec program="${build.dir}\tools\MicrosoftFxCop\FxCopCmd.exe" commandline="/p:${build.dir}\svn_platform.FxCop /o:${build.dir}\FxCop_Output\fxcop-results.xml" failonerror="f...

Having trouble running code analysis from command prompt with msbuild

I'm using VS2010 RC while targeting .NET 3.5. I can run code analysis via Visual Studio without a problem. However, when I try to run code analysis on our CI server it isn't getting executed. When I attempt to build using msbuild 4.0 I get the following exception: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\CodeAnalys...

CA2122: Do not indirectly expose methods with link demands. How to fix it in my code

CA2122: Do not indirectly expose methods with link demands. My code is as follows: public void LoadPage(Uri url) { webBrowser1.Url = url; //webBrowser1 is an object of WebBrowser webBrowser1.Refresh(); } Fxcop produced the warning "CA2122: Do not indirectly expose methods with link demands." Why this...

nant nantcontrib configuration to use fxcop

hi guys, i have question related fxcop i need to run fxcop attribute which i have implemented in nant build file. i have nant and nantcontrib . i have copied content of nantcontrib\bin to nant\bin folder i have set environment variable to FxCopCmd.exe then also i'm gettin' error when i run nant script : invalid attribute (fxcop) pls...

Overriding Object.Equals() instance method in C#; now Code Analysis / FxCop warning CA2218: "should also redefine GetHashCode". Should I suppress this in my case?

I've got a complex class in my C# project on which I want to be able to do equality tests. It is not a trivial class; it contains a variety of scalar properties as well as references to other objects and collections (e.g. IDictionary). For what it's worth, my class is sealed. To enable a performance optimization elsewhere in my system...

fxcop for silverlight code analysis - .net 3.5

Is there anyway I can run static code analysis using fxcop for silverlight code in .net 3.5 I found this article as well as a tool XAMLToolkit These are targetted towards .net 4.0 though! ...

how to give dependencies in fxcop using nant

how to give dependencies directory to fxcop,i'm using dependenciesDirectory task within fxcop but no use..may be i dn't know how to give directories.. pls any one with solution ...

FxCop hates my usage of MVVM

I've just started to work with FxCop to see how poorly my code does against its full set of rules. I'm starting off with the "Breaking" rules, and the first one I came across was CA2227, which basically says that you should make a collection property's setter readonly, so that you can't accidentally change the collection data. Since I'...

Preventing multiple reporting of the same rule violation in FxCop -- What is Id?

FxCop is currently reporting the same rule violation for a particular method -- it has two out parameters, because I want to return two values to the caller without creating a struct for it. I wonder if anonymous types would solve my problem, but I didn't know about them at the time I had written the method. Anyhow, I'm getting CheckId...

Globally disabling FxCop errors in TeamCity

Ok, another FxCop question for today. I've read the arguments regarding the IdentifiersShouldBeCasedCorrectly rule, and whether or not it should be "XML" or "Xml". Well, I'm an "XML" guy and I want to stay that way. Therefore, I do not want FxCop to correct me all of the time. I have been using the SuppressMessage attribute only for ...

__DataBind__control found by FxCop code analysis in ASP.NET

Hi, I use Visual Studio 2008 Team Suite in a website project and want to use the built-in code analysis feature (FxCop). When checking the naming rules, I get this error: CA1709: Microsoft.Naming: Korrigieren Sie die Schreibweise von "control" im Membernamen "'module_readPost_ascx.__DataBinding__control15(Object, EventArgs)'" m...

open visual studio 2008 through the location link in fxcop

Hi, I have created a class library in Visual Studio 2008. Now, I need to run the code analysis. I have used fxcop for this. I added that class library dll into the target and run the code analysis. When I go to the Analysis window and click on the target location link to open the that specified file, it's open that file in the visual stu...