fxcop

Doing .NET 4.0 static code analysis (FxCop) with VS 2010 Professional

I have VS 2010 Professional (which, unlike Premium, does not include access to Code Analysis configuration within the IDE), and a C# 4 solution containing many-dozen projects. I want to do static code analysis as part of solution compilation. The possible ways I have identified with the help of SO and Google are: Edit every .csproj in...

Cannot suppress CA1903:UseOnlyApiFromTargetedFramework

FxCop is telling me the following: "Assembly 'ILRetail.eBusiness.Common.WebUtility.dll' has a reference to assembly 'System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Because this assembly was introduced in .NET Framework 3.5 Service Pack 1, which is higher than the project's ...

fxcop CA2213 error in vs2010

Hi. I have the following code: A disposable class that contains two disposable members. One of them is being initialized using new() method, and the other using static factory method. I Also have static code analisys rules, with CA2213 as error. public class DisposableClass : IDisposable { private WebClient m_DisposableMember1; ...

Suppress FxCop CA1822 warning for whole project

Hi, we use FxCop in current project. Warning CA1822 appears for every unit test method in test projects. So I would like to disable it for test projects. Is it possible to suppress it for whole assembly? ...

How to write Code Analysis (FxCop 1.36) rule to do not concatenate strings inside loop

Hi I need to write custom fxCop rules to prevent concatenate strings inside loop.I find this link: no "Do not concatenate strings inside loops" in 1.36 beta? It was in 1.35.but who can help me solve this problem in 1.36. thanks very much! ...

Which is the most important code analysis rule and why?

A large set of code analysis rules is defined within Visual Studio and FxCop but which one do you find to be the most important and most critical to conform and why? Retrospectively, could any of the rules have saved you a lot of time/money if you had enforced them from the start or at least before your product was released? ...