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') 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>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest