You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if the issue goes here or over with the analyzers because I can find no references anywhere to the ID or where project file analyzers reside.
The issue is that if you have a project file that appends warnings to the $(NoWarn) value then an analyzer rule kicks in telling you to prepend $(NoWarn) to list and the fix appends to the value although you're already doing that.
Version Used: 8.0
Steps to Reproduce:
Create a simple C# project.
In the project file add the following property <NoWarn>$(NoWarn),CA2201</NoWarn>.
The IDE will generate an analyzer recommendation saying you should prepend the values to $(NoWarn) which is already being done.
Diagnostic Id:
Prepend $(NoWarn) to list
Expected Behavior:
This should not generate a false positive because the value(s) are being added to the list.
Actual Behavior:
Analyzer generates a warning.
The problem, I believe, is with the comma separates. Most of the documentation shows separating the values with a comma. However in the couple of cases where the docs show appending to $(NoWarn) they are separated by semicolons. There doesn't seem to be any clarification on which one is correct. The analyzer doesn't appear to support using commas. Since this syntax is valid (I believe) the analyzer should support using either comma or semicolon separators. If commas are not allowed then all the examples that show commas being used should be updated to clarify that semicolons are needed instead.
The text was updated successfully, but these errors were encountered:
@Cosifne How is this a syntax error in the csproj file? Both semicolon and commas are valid in a project file. Refer to the docs to confirm this or else the docs are wrong and need to be updated. The analyzer is the only place that this seems to be a problem with as the warnings seem to go away using either punctuator during a build.
Not sure if the issue goes here or over with the analyzers because I can find no references anywhere to the ID or where project file analyzers reside.
The issue is that if you have a project file that appends warnings to the
$(NoWarn)
value then an analyzer rule kicks in telling you to prepend $(NoWarn) to list and the fix appends to the value although you're already doing that.Version Used: 8.0
Steps to Reproduce:
<NoWarn>$(NoWarn),CA2201</NoWarn>
.Diagnostic Id:
Prepend $(NoWarn) to list
Expected Behavior:
This should not generate a false positive because the value(s) are being added to the list.
Actual Behavior:
Analyzer generates a warning.
The problem, I believe, is with the comma separates. Most of the documentation shows separating the values with a comma. However in the couple of cases where the docs show appending to $(NoWarn) they are separated by semicolons. There doesn't seem to be any clarification on which one is correct. The analyzer doesn't appear to support using commas. Since this syntax is valid (I believe) the analyzer should support using either comma or semicolon separators. If commas are not allowed then all the examples that show commas being used should be updated to clarify that semicolons are needed instead.
The text was updated successfully, but these errors were encountered: