K
KimSakLai
Guest
Hi, I installed Microsoft.CodeAnalysis.FxCopAnalyzers (Version 2.9.6) to one of our projects. One of the warning that it found was a CA1062 - Validate arguments of public methods. We are currently using custom validation method, that is implemented in referenced assembly:
public static void IsNotNull(object argToTest, string argName) { ... }
And we are using it like this:
public void foo(CustomType customType) {
Guard.IsNotNull(customType, nameof(customType));
customType.DoSomething();
}
And we have the following in '.editorconfig':
dotnet_code_quality.CA1062.null_check_validation_methods = Namespace.Guard.IsNotNull(System.Object, System.String)
But we are still getting CA1062 warning. Am I missing something? Using VS2019 (Version 16.4.2) and the project is .NET 4.7.1.
Cheers
-k
Continue reading...
public static void IsNotNull(object argToTest, string argName) { ... }
And we are using it like this:
public void foo(CustomType customType) {
Guard.IsNotNull(customType, nameof(customType));
customType.DoSomething();
}
And we have the following in '.editorconfig':
dotnet_code_quality.CA1062.null_check_validation_methods = Namespace.Guard.IsNotNull(System.Object, System.String)
But we are still getting CA1062 warning. Am I missing something? Using VS2019 (Version 16.4.2) and the project is .NET 4.7.1.
Cheers
-k
Continue reading...