Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » FAQ   (RSS)

FAQ: How do I prevent FxCop 1.36 from firing warnings against generated code?

I've upgraded from FxCop 1.35 to 1.36 and now FxCop has started to fire warnings against typed DataSets and other generated code. How do I turn this off? The reason this is occurring is because we changed the way that FxCop analyzed generated code. Whereas
Posted by David M. Kean | 5 Comments
Filed under: , ,

FAQ: Which Code Analysis rules shipped in which version?

In response to a lot of recent requests, we've put together a complete list of rules that shipped in the different versions of Visual Studio Code Analysis and FxCop. Attached is an Excel worksheet providing this information for Visual Studio 2005, Visual

Code Analysis FAQ

Find answers to commonly asked questions about Visual Studio Code Analysis. General FAQ: Why is FxCop 1.32 not available for download? FAQ: Why does FxCop generate violations against itself? Analysis and Rules FAQ: Why is file and line information available

FAQ: How do I debug a custom rule?

While writing your custom rule, you will likely come across a need to debug it and work out why it's behaving in a particular manner. Debugging within FxCop Debugging a custom rule within the FxCop UI is actually quite easy. To do so, simply: Open the

FAQ: Why is file and line information available for some warnings in FxCop but not for others?

It appears that sometimes FxCop displays a link to the source line and file in the Message Details window and sometimes it doesn't. Why this inconsistent behavior? There are three usual reasons why this occurs: Source lookup is disabled. To turn source

FAQ: How do I get the SourceContext for a local?

I want to fire on the naming of a local, however, whenever I pass the local to the Problem constructor, the source information for the method is always used. How do I get FxCop/Code Analysis to use the source information for the local instead? Because

FAQ: How do I run FxCop during a post-build event?

A little known feature of FxCop (in particular FxCopCmd.exe) is its ability to be integrated into the build process within Visual Studio. Although not a replacement for the Code Analysis functionality available within both Visual Studio Team Edition for
Posted by David M. Kean | 3 Comments
Attachment(s): VSConsoleOutput.xsl

FAQ: When looking at the names of locals in a custom rule, why do I see strange names such as 'CS$1$0000' and 'VB$1$0000'?

Previously we showed you how to access the locals or variables of a method. Once you started to run your rule over an assembly, you might start to notice strange locals with names that start with 'CS$' and 'VB$'. These are compiler generated locals that

FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?

Throwing a general exception type such as System.Exception or System.SystemException in a library or Framework forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle (see FAQ: Why does FxCop warn against

FAQ: How do I fix a violation of MovePInvokesToNativeMethodsClass?

MovePInvokesToNativeMethodsClass fires on P/Invokes (ie methods marked with DllImport) that are not members of one of the following classes; NativeMethods, SafeNativeMethods or UnsafeNativeMethods. For example, the following sample fires this warning.

FAQ: What is the GlobalSuppressions.cs/GlobalSuppressions.vb file and why is it needed? Is it possible to change the name of this file? [David Kean]

I've noticed that Code Analysis sometimes places suppressions in a file called GlobalSuppression.cs (GlobalSuppressions.vb in Visual Basic). Why this is file needed and it is possible to change its name? What is this file? When you right-click on a warning

FAQ: How do I share Managed Code Analysis rule settings over multiple projects? [David Kean]

If your team has a minbar of Managed Code Analysis rules that must be explicitly fixed or suppressed, it is possible to share the Managed Code Analysis rule settings over multiple MSBuild projects (.csproj, .vbproj). To share the minbar between multiple

FAQ: Why is FxCop 1.32 not available for download? [David Kean]

Update: While SharePoint Portal Server 2003 will not run side-by-side with .NET 2.0, SharePoint Portal Server 2003 SP2 will. For more information, see: http://support.microsoft.com/kb/907763 . We have had a lot of users contacting us since we released

FAQ: Why does FxCop warn against catch(Exception)? - Part 3 [Nick Guerrera]

This is the third installment in a three-part series on why FxCop warns against catch(Exception): FAQ: Why does FxCop warn against catch(Exception)? - Part 1 FAQ: Why does FxCop warn against catch(Exception)? - Part 2 FAQ: Why does FxCop warn against

FAQ: Why does FxCop warn against catch(Exception)? - Part 2 [Nick Guerrera]

This is the second installment in a three-part series on why FxCop warns against catch(Exception): FAQ: Why does FxCop warn against catch(Exception)? - Part 1 FAQ: Why does FxCop warn against catch(Exception)? - Part 2 FAQ: Why does FxCop warn against
More Posts Next page »
 
Page view tracker