fxcop

FxCop folder missing

冷暖自知 提交于 2019-12-04 17:56:29
问题 What is the issue? I am trying to install FxCop 10. To install that, Microsoft Windows SDK 7.1 is required. I installed the SDK. Now, to install FxCop, I have to run FxCopSetup.exe, which is supposed to be located in the folder %ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\FxCop. But, that folder is missing. What I did to try to fix it? I searched the web to fix the issue, and I tried a couple of workarounds that were suggested in a few discussions including (1) not doing a full installation

c# warning - Mark assemblies with NeutralResourcesLanguageAttribute

柔情痞子 提交于 2019-12-04 16:37:55
问题 I'm getting the following warning: " CA1824 Mark assemblies with NeutralResourcesLanguageAttribute" According to MSDN, the cause of this is: An assembly contains a ResX-based resource but does not have the System.Resources.NeutralResourcesLanguageAttribute applied to it. Could anyone please explain what it means? I don't want to define specific culture setting. I want them to be customisable. 回答1: The NeutralResourcesLanguageAttribute informs the resource manager of the language that was used

How to validate DataReader is actually closed using FxCop custom rule?

一世执手 提交于 2019-12-04 14:51:35
I have written couple of custom rules in for FxCop 1.36. I have written code to find weather an opened DataReader is closed or not. But it does not check which DataReader object is calling the Close() method so I can't be sure if all opened DataReader objects are closed!! 2nd: If I am a DataReader in an 'if/else' like if 1=2 dr = cmd.ExecuteReader(); else dr = cmd2.ExecuteReader(); end if In this case it will search for 2 DataReader objects to be closed. I am putting my code for more clarity. public override ProblemCollection Check(Member member) { Method method = member as Method; int

VS2010 code analysis. Suppress message CA1051:DoNotDeclareVisibleInstanceFields for all class members

依然范特西╮ 提交于 2019-12-04 09:04:50
I have a class like this one: public class Foo { public readonly int A = 1; public readonly int B = 2; } When I run VS2010 built in Code Analysis tool, I get 2 identical warnings: that ' field '...' is visible outside of its declaring type, change its accessibility to private and add a property, with the same accessibility as the field has currently, to provide access to it '. I want to suppress this warning for all fields in my class Foo , but I don't want to mark every field with SuppressMessage attribute like this: public class Foo { [SuppressMessage("Microsoft.Design", "CA1051

Error in FxCop Phoenix analysis engine

≡放荡痞女 提交于 2019-12-04 07:33:24
So I'm trying to run a bunch of rules which are defined in a RuleSet. The RuleSet file is actually generated using Sonarqube - I've selected absolutely all rules in there, including the FxCop, ReSharper and StyleCop rules. I'm kicking off FxCop like this: C:/FxCop/FxCopCmd.exe /file:C:\TestProject\bin\TestProject.dll /ruleset:=C:\TestProject\testproject.ruleset /out:C:\TestProject\fxcop-report.xml /outxsl:none /forceoutput /searchgac /aspnet It starts correctly, but I get the following message: Initializing Introspection engine... Analyzing... Initializing Phoenix engine... Analyzing...

Visual Studio 11 Developer Preview - Breaking FxCop Static Analysis

旧巷老猫 提交于 2019-12-04 06:28:51
问题 After installing the Developer Preview our Custom FxCop rules project won't build as the following Dll's can't be found: FxCopSdk.dll & Microsoft.Cci.dll It turns out that this is a red herring, looking at the project for the custom rules on other's machines, it doesn't build without re-referencing the aforementioned dll's correctly (so that's normal) the real problem is that our existing build is using the VS11 code analysis. I've now removed VS11 but it's still not working! Any ideas?

How can the cyclomatic complexity be 27 in a method with 13 event handler subscriptions?

ぐ巨炮叔叔 提交于 2019-12-04 04:49:36
We have this code, sortof: private void InitializeEvents() { this.Event1 += (s,e) => { }; this.Event2 += (s,e) => { }; this.Event3 += (s,e) => { }; this.Event4 += (s,e) => { }; this.Event5 += (s,e) => { }; this.Event6 += (s,e) => { }; this.Event7 += (s,e) => { }; this.Event8 += (s,e) => { }; this.Event9 += (s,e) => { }; this.Event10 += (s,e) => { }; this.Event11 += (s,e) => { }; this.Event12 += (s,e) => { }; this.Event13 += (s,e) => { }; } Code analysis in VS10 Ultimate says "cyclomatic complexity of 27". Removing one of the lines makes the cyclomatic complexity 25. There's no branching going

CS8019 Error on Assemblyinfo on temp file MSBuild Server

我们两清 提交于 2019-12-04 03:08:42
问题 I am getting a code analysis error on my build server the error is ...NETFramework,Version=v4.6.AssemblyAttributes.cs(3,1): error CS8019:Unnecessary using directive. This is in a Temp file which Visual Studio creates. In my project I have "Suppress results from generated code (managed only)" ticked. I would have thought that would be enough. But I still get the error on the server and locally i get none. Any ideas? 回答1: Googling for CS8019 AssemblyAttributes yielded many interesting articles,

How to prevent FxCop from analyzing auto-generated code?

假装没事ソ 提交于 2019-12-04 02:57:49
FxCop (tool for static code analysis) gives me an error while checking code behind of .edmx model. How to prevent FxCop from analyzing auto-generated code (or at least Entity Framework generated classes)? I have moved to Visual Studio Code Analysis, as it gives me the same functionality as FxCop. From FxCop blog : "That's correct, they are different products (FxCop and VS Code Analysys), however they do have a common engine. Visual Studio 2008 SP1 already comes with the same fixes and analysis (plus a little bit more), so there is no need to 'update' Visual Studio with the latest FxCop." But

FxCop 1.36 is gone [closed]

孤者浪人 提交于 2019-12-03 22:31:32
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I just wanted to download FxCop 1.36 but I can't find it in the internet. A few days ago FxCop 10 came out for Windows 7 but I need the old Version. The file is gone on the MS server and everybody linked it. Anyone has the old install routine? I have the 1.36 installer...If you still need it, I could put it up on my Dropbox for you... Edit: here's the link to the 1.36 installer . Enjoy! Go Here C: