fxcop Questions
9
How is it possible to get the FxCop custom dictionary to work correctly?
I have tried adding words to be recognised to the file 'CustomDictionary.xml', which is kept in the same folder as the FxCo...
Conni asked 11/12, 2008 at 13:13
4
Solved
I'm just curious what Afx stands for. And what about Fx in FxCop?
3
Solved
I'm trying to install fxcop analyzers in my project. However, having added and restored the nuget package, building the project results in hundreds of warnings of the form
1>CSC : warning CS80...
Thyroiditis asked 22/7, 2019 at 9:35
5
Solved
I encountered this FxCop rule before and wasn't really content with how to solve violations (thread1, thread2). I now have another case where I need to correct violations of the CA1819 kind.
Speci...
3
Solved
I'm trying to add Microsoft.CodeAnalysis.FXCopAnalyzers (latest stable version) to my ASP.NET project. When I install it via NuGet, I get a ton of errors like:
An instance of analyzer Microsoft....
Nereus asked 25/1, 2019 at 18:7
5
Solved
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 ...
3
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, ReSh...
Connie asked 27/5, 2015 at 18:26
6
Solved
I usually add an m_ in front of private fields and an s_ before static members.
With a code like
protected static readonly Random s_Random = new Random ();
I get the following warnings by VS200...
Vaporescence asked 27/4, 2009 at 12:16
2
Solved
My code gets the CA1303 warning from Microsoft.Globalization, "Do not pass literals as localized parameters", but my code is not actually passing a literal:
private void MyForm_Load(objec...
Redwing asked 21/3, 2012 at 12:45
2
Is there any FxCop or StyleCop that warns when there is an using statement that is no longer referenced by any object in the file?
Creon asked 19/8, 2016 at 15:58
1
Solved
When I run FxCop on my project, I get a large number of warnings with the ID of CA2007. This ID is missing from the docs (it just skips from CA2006 to CA2100), but the message I get is:
Do not d...
Selfgovernment asked 30/11, 2018 at 1:45
5
Solved
I'm publishing an ASP.NET Core MVC 3.0 website and the output folder contains lots of reference in many language to Microsoft.CodeAnalysis librairies, someone knows why?
Of course the FxCopAnalyze...
Byandby asked 8/10, 2019 at 17:18
14
Solved
In Kathleen Dollard's 2008 blog post, she presents an interesting reason to use nested classes in .net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the peop...
3
The Roslyn Analyzers are installed as nuget packages, which are dependencies of the FxCop Analyzers (also installed as nuget packages).
I have enabled full solution analysis as instructed here: H...
Jardena asked 7/6, 2019 at 22:4
5
Solved
I use underscores for my test methods for a better readability and I want to suppress FxCop errors/warnings for the whole test namespace.
How can I achieve this? I played with GlobalSuppressions.c...
Roughish asked 6/7, 2012 at 9:37
3
Solved
I have the following code in my application:
[DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hwnd, int index);
[DllImport("user32.dll")]
private static extern int SetWind...
Trifurcate asked 20/10, 2011 at 14:25
2
Solved
Lately, I've been working on enabling more of the Visual Studio code analysis rules in my projects. However, I keep bumping into rule CA2227: "Collection properties should be read only".
Say I hav...
Culex asked 30/8, 2013 at 17:19
5
Solved
I have a class with two constructors that look like this:
public MyClass(SomeOtherClass source) : this(source, source.Name) { }
public MyClass(SomeOtherClass source, string name) { /* ... */ }
W...
Yod asked 29/6, 2009 at 18:8
3
Solved
Let's say I have an enumeration of all currencies:
public enum CurrencyType
{
/// <summary>
/// United Arab Emirates dirham
/// </summary>
[EnumMember]
AED = 784,
/// <summar...
Kiaochow asked 2/9, 2015 at 15:19
2
Solved
I have following extension method for strings:
public static bool IsNullOrEmpty(this string target)
{
return string.IsNullOrEmpty(target);
}
... and in the code I use it as follows:
public sta...
Gross asked 3/3, 2013 at 17:44
3
Solved
public class MultiSomething { } //CA1704:IdentifiersShouldBeSpelledCorrectly
When I run Code Analysis, I get an error because the Microsoft does not recognize the word 'Multi' (go figure they use...
Kymry asked 21/10, 2011 at 19:47
2
Solved
I'm toying with getting our team and projects ready for VS 2019. Right away, trying to set up Code Analysis for a new project, I find this:
So, if this is deprecated (and apparently can't even b...
Fulgurite asked 9/4, 2019 at 17:23
3
Solved
Premise
When using code analysis (or fxCop) with C# optional parameters you can get a warning of CA1026. The short reason1 for this is not suppling all parameters with a default value.
The declar...
Venable asked 20/7, 2010 at 16:1
1
Solved
I am trying to edit a custom ruleset file for FxCop. When I open a ruleset file I receive this message:
Width of the image strip must be a positive multiple of
ImageSize.Width
Parameter name: valu...
Alis asked 11/6, 2015 at 12:7
1
Solved
I am creating a .Net Standard 2.0 Nuget package and I want to perform static code analysis for the build. However, when I add the Microsoft.CodeAnalysis.FxCopAnalyzers package it becomes a runtime ...
Washery asked 13/8, 2018 at 19:27
1 Next >
© 2022 - 2024 — McMap. All rights reserved.