Visual Studio Code Analysis and Code Metrics announcement
-
Link
Please see our blog for a description of the new Code Analysis functionality available in Visual Studio 2010: http://blogs.msdn.com/codeanalysis/archive/2010/03/22/what-s-new-in-code-analysis-for-visual-studio-2010.aspx
-
Link
Version 10.0 of FxCop is the version that ships with Visual Studio 2010 Premium. FxCop 10.0 is part of Version 7.1 of the Microsoft Windows SDK for Windows 7 and .NET Framework 4.
Instructions
- Download the Microsoft Windows SDK for Windows 7 and .NET Framework 4 Version 7.1
- Using elevated privileges execute FxCopSetup.exe from the %ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop folder.
-
Link
This forum has been locked; it will still be available for review in the Archived Forums folder. Any future posts on this topic should be put in the Visual Studio Debugger forum.
-
Link
Following is a collection of Frequently Asked Questions (FAQ) regarding PreFAST, FxCop, Managed Code Analysis and Code Metrics.
Visual Studio 2010 Rule Sets
Question: How do I ensure that the same code analysis rule set is used for all the projects developed by my team(s)?
Answer: See JB Browns blog post on this topic.
Rule Behavior
Question: Why does FxCop generate violations against itself?
Answer: Answered on the FxCop blog.
Question: Why do some sources recommend extending ApplicationException while FxCop does not?
Answer: Answered on the FxCop blog.
Question: Why does FxCop ignore my in-code (SuppressMessageAttribute) suppressions?
Answer: Answered on the FxCop blog.
Question: Why does DoNotExposeGenericLists recommend that I expose Collection<T> instead of List<T>?
Answer: Answered on the FxCop blog.
Question: How do I indicate to DoNotDeclareReadOnlyMutableReferenceTypes that a type is immutable?
Answer: Answered on the FxCop blog.
Custom Rule Development
Question: How do I integrate my custom FxCop rules into Visual Studio 2010?
Answer: Answered on the FxCop blog.
Question: Where is the official FxCop custom rules SDK?
Answer: There is currently no official custom rules SDK developed by Microsoft. The primary reason is that we are currently rewriting key components of the FxCop metadata reader and data flow analysis engine. This work guarantees that rules written today will need to be modified or entirely re-written in the future. Rules developers who have been working in FxCop for the past few years can attest to the fact that every release has involved some churn in the custom rules API. Each release readme contains detailed information about porting existing rules to the latest architecture.
As soon as the FxCop metadata and other relevant API stabilize sufficiently, we will develop an official FxCop custom rules SDK with samples demonstrating common patterns written in several languages. Until then, there are several resources available to custom rules developers:
· This forum. Post your rules development questions here.
· Rules samples uploaded to the MSDN Code Gallery. Search for 'FxCop'.
· Rules samples developed externally. Search the web for 'fxcop' and 'rules'
· Visit the custom rules category on the FxCop blog
Question: How do I integrate custom rules with Visual Studio?
Answer: Answered on the FxCop blog.
Question: How do I access the locals for a method?
Answer: Answered on the FxCop blog.
-
Sticky2VotesFxCop 1.36 Released!
We've released FxCop 1.36. See the following for more information: http://blogs.msdn.com/fxcop/archive/2008/08/19/fxcop-1-36-released.aspx -
Sticky3VotesTell me what kind of Custom Rule you want to write!!!
I am a program manager for our Code Analysis system. I want to know what kind of custom rules you would like to write. Ignore what you may or may not know about what's in FxCop ... -
Sticky0VotesFxCop Blogs
Following is a list of blogs containing FxCop content and by FxCop team members. FxCop Team Blog http://blogs.msdn.com/fxcop Visual Studio Team System ...
-
Answered0VotesFxCopCmd.exe exit codes
Hi everyone out there! I've been using fxcopcmd.exe from MsBuild and I keep getting a 513 exit code after running the analysis. Do you know what this code means? Is there a place online where I can ... -
Answered0VotesQuestion about CA1819: PropertiesShouldNotReturnArrays
Heya folks, i have a property that returns a byte array /// <summary> /// Binary data of the ringtone. /// </summary> public byte[] ... -
Answered0VotesVS2012 Code Analysis Window Doesn't Work
I've been working on transitioning our team to VS2012 and I actually thought the Code Analysis window wasn't supposed to work if building any project that includes v4 tools and/or targeting .NET 4.0. ... -
Answered1VotesVS2012 Impacts VS2010 Code Analysis?
I have read a couple of MSDN posts on this topic but they appear to be different issues. We did some experiments in a VM whereby both VS2010 and VS2012 are installed side-by-side since this is the ... -
Answered0VotesDaily, weekly, monthly, yearly sales report in crystal report.
hi ! can some help me in making report for my Point of sales and inventory system?im making report as it will allow the user to choose from daily, weekly, monthly, quarterly, ... -
Answered0VotesVS 2012 / FxCop / Spelling
Hi, I'm struggling with the custom dictionary. I've got a class "OAuthToken" that fires CA1704 because "Auth" is unknown. Basically that's ... -
Answered0VotesCode Coverage with VSTools using Visual Studio 2010
I wanted to use Code Coverage using Visual Studio 2010 ultimate edition. My requirement is to have vsinstr.exe and VSPerfCmd.exe available as part of VS ... -
Unanswered0VotesPrefast not detecting SAL errors
Visual Studio 2008 9.0.30729.1 SP .NET Framework 3.5 SP1 WinDDK 7600.16385.1 The Prefast option resolves to the ... -
Answered0VotesHow does VS 2010 and VS 2012 know which version of fxcopcmd.exe to use?
A developer on my team was evaluating VS 2012 with a project that performs code analysis. He found that a greater number of fails occured against the same ... -
Answered0VotesCode Analysis errors are not showing line details in Vsts 2012
Hi, I have installed vsts 2012 on my machine and enabled code analysis for my projects. I made all the code analysis warnings to appear as ... -
Proposed0VotesFxCop 10 report with absent exclusions in source information
Hi all, with FxCop 1.35 we did something like this within a FxCop project file: <SaveMessages> <Project Status="Active, Excluded" ... -
Answered0VotesFxCop custom rule to check the use of property
I want to check if the code has been used visible property. How to check the check method in FxCop ? Thanks. -
Answered1VotesHow to know the method that hangs in .net process built on release
I have the dump files of a .net process that hangs in an unknown location. I need to know the method where the hang is occurring. The application is very complex with many threads, ... -
Answered0VotesFxCop update for VS 2012 and .NET 4.5
Will there be an update to the stand alone FxCop (FxCop 11?) to support code analysis outside of VS 2012 for the non-premium/ultimate SKU's and to support .NET 4.5? -
Answered0VotesReviewSqlQueriesForSecurityVulnerabilities Missing Rule
Hi, I am using VS2010 Pro edition which means I don't get FxCop Code Analysis pre-integrated. I downloaded FxCop 1.36 separately and running it. However, FxCop does not seem to have ... -
Answered0VotesCode Analysis Error CA0001: An unknown error occurred while running Code Analysis
I have inherited a rather large and old code base. I'm interested in running code analysis to identify dead code. There's lots of it and it's driving me crazy. I'm getting the error ... -
Answered6VotesCode metrics for unmanaged C++ code?
Does code metrics in Visual Studiu 2008 Tema System work for unmanaged C++ code? -
Answered1VotesHow can I integrating latest Window SDK developer tools with VS 2008 professional edition so that I can use the \Analyze Static code analysis feature.
I have a Visual Studio 2008 professional edition. I know that VS 2008 Professional edition does not contain the /Analyze feature , but I have read some where that I can integrate the latest ... -
Answered1VotesFxCop 1.36: 'Referenced assembly could not be found' for assemblies in GAC
I am using FxCop 1.36 and VS2008 SP1. We have a number of solutions and projects in our organization. Some are placed in the GAC by a post-build ... -
Discussion0Votes"Object is currently in use elsewhere" error for picturebox
Hello everyone, I created a GUI for plotting values in a picture box. I get values from a serial port every hour, store it in an array then plot those values using ... - Items 1 to 20 of 2888 Next ›


