Visual Studio Code Analysis and Code Metrics
Discuss issues regarding FxCop and Visual Studio's Code Analysis features, including both Managed and C/C++ Code Analysis, Code Analysis Policy and Code Metrics.
הכרזות
- קישור
What's new in Code Analysis for Visual Studio 2010
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 - קישור
FxCop Version 10.0 is available
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.
- קישור
This Forum Has Been Retired
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.
- קישור
Frequently Asked Questions (FAQ)
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.
סינון ומיוןהשתמש באפשרויות אלה כדי לצמצם את רשימת השאלות והדיונים.
- 8239916

Tell me what kind of Custom Rule you want to write!!!
Joe Rohde יום רביעי 04 יולי 2007 01:35 - 954153

FxCop 1.36 Released!
Haiying Xu - MSFTMicrosoft Employeeיום שלישי 19 אוגוסט 2008 20:41 - 025602

FxCop Blogs
David M. KeanMicrosoft Employeeיום חמישי 13 אפריל 2006 14:06 - 28816

FxCopCmd.exe exit codes
acyment יום שלישי 03 יולי 2007 17:54 - 69481

Question about CA1819: PropertiesShouldNotReturnArrays
Pure Krome יום ראשון 29 ינואר 2006 03:48 - 31646

VS2012 Code Analysis Window Doesn't Work
Scott C Parillo יום ראשון 02 דצמבר 2012 16:35 - 92502

VS2012 Impacts VS2010 Code Analysis?
Scott C Parillo יום שלישי 20 נובמבר 2012 00:42 - 11807

Daily, weekly, monthly, yearly sales report in crystal report.
Wil sara יום חמישי 06 דצמבר 2012 11:52 - 41533

VS 2012 / FxCop / Spelling
MIrle יום רביעי 05 דצמבר 2012 11:39 - 31782

Code Coverage with VSTools using Visual Studio 2010
_Pankaj יום שלישי 27 נובמבר 2012 03:27 - 34029

Prefast not detecting SAL errors
John Thewlis יום רביעי 07 ספטמבר 2011 15:29 - 73717

How does VS 2010 and VS 2012 know which version of fxcopcmd.exe to use?
StevenIBSI יום שישי 21 ספטמבר 2012 20:13 - 21473

Code Analysis errors are not showing line details in Vsts 2012
Sirisha M יום שלישי 27 נובמבר 2012 13:17 - 112109

FxCop 10 report with absent exclusions in source information
Peter Brightman יום שלישי 16 אוקטובר 2012 13:27 - 31601

FxCop custom rule to check the use of property
damiano626 יום שני 19 נובמבר 2012 14:53 - 11364

How to know the method that hangs in .net process built on release
sak.saw יום ראשון 18 נובמבר 2012 14:32 - 27676

FxCop update for VS 2012 and .NET 4.5
Carel.Lotz יום שישי 14 ספטמבר 2012 09:21 - 11403

ReviewSqlQueriesForSecurityVulnerabilities Missing Rule
Khalid Ashraf יום שישי 16 נובמבר 2012 17:10 - 21766

Code Analysis Error CA0001: An unknown error occurred while running Code Analysis
Arhiannas יום שלישי 06 נובמבר 2012 19:43 - 2820736

Code metrics for unmanaged C++ code?
Anchy יום רביעי 08 אוקטובר 2008 10:15 - 31369

How can I integrating latest Window SDK developer tools with VS 2008 professional edition so that I can use the \Analyze Static code analysis feature.
27Prac יום רביעי 31 אוקטובר 2012 11:32 - 67063

FxCop 1.36: 'Referenced assembly could not be found' for assemblies in GAC
jonwithoutanh יום חמישי 02 אוקטובר 2008 19:37 - 11609

"Object is currently in use elsewhere" error for picturebox
TrinetteK יום שני 22 אוקטובר 2012 07:32