Roslyn: How to Fix Rs2008 Warning?
This Question Is Also Asked Here: in Roslyn 3.8.0, There Is Rs2008 Warning (Enable Analyzer Release Tracking for the Analyzer Project Containing Rule 'Eo0001')...
This question is also asked here:
In Roslyn 3.8.0, there is RS2008 warning (Enable analyzer release tracking for the analyzer project containing rule 'EO0001') for the following code:
internal static class Rules
{
public static readonly DiagnosticDescriptor InvalidFieldAttribute = new DiagnosticDescriptor(
DiagnosticIds.InvalidFieldAttribute,
new LocalizableResourceString(nameof(Resources.InvalidFieldAttribute_Title), Resources.ResourceManager, typeof(Resources)),
new LocalizableResourceString(nameof(Resources.InvalidFieldAttribute_Message), Resources.ResourceManager, typeof(Resources)),
DiagnosticCategories.Usage, DiagnosticSeverity.Warning, isEnabledByDefault: true);
}
Press CTRL-. to quick fix by adding the following two files:
AnalyzerReleases.Shipped.md:
; Shipped analyzer releases
;
## Release 1.0
### New Rules
Rule ID | Category | Severity | Notes
--------|----------|----------|--------------------
OE0001 | Usage | Warning | InvalidFieldAttribute
AnalyzerReleases.Unshipped.md:
; Unshipped analyzer release
;
However the RS2008 warning is still there.
What am I missing?
1 Answer
Got the answer from by adding AdditionalFiles in the project file:
<ItemGroup>
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
</ItemGroup>