Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RS2002 reported after updating to .NET SDK 6.0.200 #5890

Open
atifaziz opened this issue Feb 19, 2022 · 2 comments
Open

RS2002 reported after updating to .NET SDK 6.0.200 #5890

atifaziz opened this issue Feb 19, 2022 · 2 comments

Comments

@atifaziz
Copy link

atifaziz commented Feb 19, 2022

Analyzer

Diagnostic ID: RS2002 (Rule '…' is part of the next unshipped analyzer release, but is not a supported diagnostic for any analyzer)

Describe the bug

After updating to .NET SDK 6.0.200, my project with a C# source generator is producing RS2002 errors. The same project builds when compiled with the previous .NET SDK version 6.0.102 so there seems to be some sort of regression introduced.

Steps To Reproduce

  1. Install .NET SDK 6.2.200
  2. Clone the repo at https://github.com/docopt/docopt.net
  3. Checkout commit 09d814b987cc10d1de186a7a2ef33e90b9cef918 (the commit at time of reporting this issue)
  4. Change the current working directory in your shell to the directory of the local clone
  5. Run dotnet build

The above steps can be exercised with the following Docker command-line:

docker run --rm --entrypoint bash mcr.microsoft.com/dotnet/sdk:6.0.200 -c 'git clone https://github.com/docopt/docopt.net.git && cd docopt.net && git checkout 09d814b && dotnet build'

Expected behavior

Expected the build to succeed for all target frameworks when using .NET SDK 6.0.200.

Actual behavior

The following errors are emitted:

CSC : error RS2002: Rule 'DCPT0001' is part of the next unshipped analyzer release, but is not a supported diagnostic for any analyzer [/docopt.net/src/DocoptNet/DocoptNet.csproj]
CSC : error RS2002: Rule 'DCPT0002' is part of the next unshipped analyzer release, but is not a supported diagnostic for any analyzer [/docopt.net/src/DocoptNet/DocoptNet.csproj]
CSC : error RS2002: Rule 'DCPT0001' is part of the next unshipped analyzer release, but is not a supported diagnostic for any analyzer [/docopt.net/src/DocoptNet/DocoptNet.csproj]
CSC : error RS2002: Rule 'DCPT0002' is part of the next unshipped analyzer release, but is not a supported diagnostic for any analyzer [/docopt.net/src/DocoptNet/DocoptNet.csproj]

Additional context

When using the previous version of the SDK (6.0.102), the build succeeds for the exact same commit:

docker run --rm --entrypoint bash mcr.microsoft.com/dotnet/sdk:6.0.102 -c 'git clone https://github.com/docopt/docopt.net.git && cd docopt.net && git checkout 09d814b && dotnet build'

If I delete the AnalyzerReleases.*.md files then the build succeeds too.

@Youssef1313
Copy link
Member

@atifaziz This is a known issue currently. You'll have to avoid target-typed new for the DiagnosticDescriptor to get this fixed.

atifaziz pushed a commit to docopt/docopt.net that referenced this issue Feb 19, 2022
- Reverts "Suppress warning RS2002 (possible regression in .NET SDK
  6.0.200)" (or commit 1a72369) from
  PR #161.

- Avoids target-typed new for "DiagnosticDescriptor" as workaround to
  issue dotnet/roslyn-analyzers#5890.
brandonh-msft added a commit to dotnet/upgrade-assistant that referenced this issue May 10, 2022
brandonh-msft added a commit to dotnet/upgrade-assistant that referenced this issue May 10, 2022
brandonh-msft added a commit to dotnet/upgrade-assistant that referenced this issue May 10, 2022
@Applesauce314
Copy link
Contributor

looks like this issue could be closed per
#5828
#6119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants