dotnet / dotnet/sdk

rulesets subdirectory missing from published NetAnalyzers nupkg

Closed
#54,046 4 comments 2 reactions 2 assignees Claimed by @jeffhandley View on GitHub
Area-Microsoft.CodeAnalysis.NetAnalyzers Bug
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug

"rulesets" subdirectory (and contents) are missing from published `Microsoft.CodeAnalysis.NetAnalyzers` packages for versions 10.*.

### To Reproduce

- Go to https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers/10.0.203, click "Open in NuGet Package Explorer" and look at the file list. There is no "rulesets" subdirectory.
- You can also download the .nupkg file, extract it, and verify this on your local machine.

I looked through many different 10.x versions of the nuget package, but did not see the "rulesets" subdirectory. On the other hand, I see the "rulesets" subdirectory in the 9.0.0 package version.

Although the "rulesets" directory is not present in the published NuGet package, the "rulesets" directory exists when I build the NuGet package locally on Windows using Visual Studio 2026:

- Clone this `dotnet/sdk` repository.
- Check out branch `release/10.0.2xx`.
- Open `src\Microsoft.CodeAnalysis.NetAnalyzers\Microsoft.CodeAnalysis.NetAnalyzers.slnx` in Visual Studio (I used VS 2026 18.4.3).
- Change solution configuration to "Release".
- Right click on `Microsoft.CodeAnalysis.NetAnalyzers.Package` project and select **Pack**. Wait for packing to complete.
- Using File Explorer, go look in "Microsoft.CodeAnalysis.NetAnalyzers.10.0.202-dev.nupkg" archive under `artifacts\packages\Release\Shipping` directory on disk (relative to repository root directory).
- The "rulesets" subdirectory exists here. Why isn't it in the NuGet package published on nuget.org??

### Remarks

I maintain an application that makes use of the ruleset files, so I am dismayed to find them missing.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.