fxcop

Can't suppress CA1709 in any way

六眼飞鱼酱① 提交于 2020-01-03 00:22:49
问题 I want to suppress CA1709: Identifiers should be cased correctly, on public class IDd . For example i want to use IDd as correct word. But i can't. I tried everything at code analysis dictionary: <?xml version="1.0" encoding="utf-8"?> <Dictionary> <Words> <Unrecognized> <Word></Word> </Unrecognized> <Recognized> <Word>d</Word> <Word>IDd</Word> </Recognized> <Deprecated> <Term PreferredAlternate=""></Term> </Deprecated> <Compound> <Term CompoundAlternate="IDd">IDd</Term> </Compound>

Is FxCop's CollectionPropertiesShouldBeReadOnly rule incompatible with the spring framework?

混江龙づ霸主 提交于 2020-01-02 10:05:35
问题 FxCop has the CollectionPropertiesShouldBeReadOnly rule that complains if your class has some kind of collection property that clients can set. Instead, it suggests making the property read-only and supplying a Clear() method and Add() or AddRange() methods for changing the contents of the collection. I agree that makes for a cleaner and more controlled interface, but I'm struggling to make that interface work with the Spring framework. If I want to configure an object with a collection of

Is FxCop's CollectionPropertiesShouldBeReadOnly rule incompatible with the spring framework?

℡╲_俬逩灬. 提交于 2020-01-02 10:05:26
问题 FxCop has the CollectionPropertiesShouldBeReadOnly rule that complains if your class has some kind of collection property that clients can set. Instead, it suggests making the property read-only and supplying a Clear() method and Add() or AddRange() methods for changing the contents of the collection. I agree that makes for a cleaner and more controlled interface, but I'm struggling to make that interface work with the Spring framework. If I want to configure an object with a collection of

How to specify CodeAnalysisRules in MSBuild via commandline

眉间皱痕 提交于 2020-01-02 04:55:11
问题 I want to be able to specify the Code AnalysisRules in commandline MSBuild (for Code Analysis / FXCOP). The project file would have something like this in it: <CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302</CodeAnalysisRules> So I would assume that I use something like this: MSBuild.exe /property:RunCodeAnalysis=true /property:CodeAnalysisRules=-Microsoft.Globalization#CA1301 Which works fine, but when I want to add another rule, it does not like the semi

Error in FxCop Phoenix analysis engine

人走茶凉 提交于 2020-01-01 11:45:20
问题 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

Get FxCop to suppress warnings for a whole type?

白昼怎懂夜的黑 提交于 2019-12-30 08:17:23
问题 How can I suppress FxCop warnings for a whole type? namespace ConsoleApplication1 { public static class Serializer<T> { public static string Serialize(T obj) { return string.Empty; } public static T Deserialize(string str) { return default(T); } } I tried this, but it is not working for me: [assembly: SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes", Scope = "Type", Target = "ConsoleApplication1.Serializer'1")] 回答1: Unfortunately, this will not work. FxCop

CA1500 vs. SA1309 - Which one wins?

百般思念 提交于 2019-12-30 03:44:04
问题 I'll prefix by saying that I understand that both Code Analysis and StyleCop are meant as guidelines, and many people chose to ignore these anyway. But having said that, I'd like to see what the general consensus is with regard to these two rules. Rule CA1500 says don't make parameter names and private field names the same. Rule SA1309, on the other hand, says don't prefix members with underscore or "m_". This leaves us with little options for distinguishing private backing fields from their

Is there a StyleCop/FxCop autofixing tool? [closed]

爱⌒轻易说出口 提交于 2019-12-29 19:22:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Is there a tool that can automatically fix StyleCop and FxCop rules, rather than manually fixing thousands of warning and errors? There must be one, it is such a good business opportunity! 回答1: No, frustratingly . That's why Style Cop is counter-productive. Consistent formatting looks nice, but there's little

PresentationFramework DLL could not be loaded

送分小仙女□ 提交于 2019-12-25 18:41:44
问题 I am running a TeamCity build which is running FXCop Analysis. Getting the following error: [INFO] 2>Project : error : CA0058 : The referenced assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be found. Now, this error is coming on only one of the machines, and he build is running fine on all remaining ones. I've checked the following (same on all the machines) Checked that the assembly is present in GAC Verified that Visual Studio

Cannot find the .pdb file inferred from the property sonar.cs.fxcop.assembly

本小妞迷上赌 提交于 2019-12-24 12:11:53
问题 Error during Sonar runner execution. Cannot find the .pdb file e:\builds\XYZ\zz_Sonar\XYZ\Main\Source\XYZ\Binaries\XYZ.WinForms.UI.pdb inferred from the property sonar.cs.fxcop.assembly . The XYZ.WinForms.UI .NET project is a Windows app and generates an exe not a dll or resulting pdb file. Why is Sonar looking for it? This is a VS 2010 solution. We are using Sonar Qube 4.4. Plugins C# version 3.2.1, Analysis Bootstrapper for Visual Studio Projects version 1.2. Java version 1.7.0_45-b18. Here