Skip to content

chore: drop redundant System.Collections.Immutable reference (NU1510) - #586

Merged
jeremydmiller merged 1 commit into
mainfrom
fix/583-nu1510-immutable
Jul 29, 2026
Merged

chore: drop redundant System.Collections.Immutable reference (NU1510)#586
jeremydmiller merged 1 commit into
mainfrom
fix/583-nu1510-immutable

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Closes #583

What

Every restore emitted:

src/CodegenTests/CodegenTests.csproj : warning NU1510: PackageReference
System.Collections.Immutable will not be pruned. Consider removing this package
from your dependencies, as it is likely unnecessary.

CodegenTests genuinely uses the type — src/CodegenTests/VariableTests.cs:62 references ImmutableHashSet<string> — but System.Collections.Immutable has been in-box since .NET Core 3.x, and this project targets net9.0;net10.0. The type resolves from the framework either way, so the explicit reference adds nothing.

Beyond the one line the issue called for: CodegenTests was the only consumer, so the matching PackageVersion entry in Directory.Packages.props is removed too rather than left behind as a dangling central version.

Why it matters

This was the last remaining restore warning in the solution now that #579 cleared the MessagePack advisories (and #585 clears the build/ ones). dotnet restore jasperfx.slnx is now completely clean — which is the point: it makes future restore warnings actually visible instead of arriving in a pile of known noise.

Verification

$ dotnet restore jasperfx.slnx
  (no NU1510 — no warnings at all)

$ dotnet test src/CodegenTests --framework net9.0
  Passed! - Failed: 0, Passed: 419, Skipped: 0, Total: 419

419 matches the baseline recorded in #581. VariableTests.cs compiles unchanged on the framework-provided type.

🤖 Generated with Claude Code

Every restore emitted NU1510 for CodegenTests: the PackageReference on
System.Collections.Immutable "will not be pruned ... likely unnecessary."

CodegenTests does use the type (VariableTests.cs:62 references
ImmutableHashSet<string>), but System.Collections.Immutable has been
in-box since .NET Core 3.x and this project targets net9.0;net10.0 - the
type resolves from the framework with or without the reference.

CodegenTests was the only consumer, so the PackageVersion entry in
Directory.Packages.props goes with it rather than being left behind as a
dangling central version.

This was the last remaining restore warning in the solution, so
`dotnet restore jasperfx.slnx` is now fully clean - which is what makes
future restore warnings actually visible.

CodegenTests: 419 passed, matching the baseline.

Closes #583

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit aa3d564 into main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NU1510: redundant System.Collections.Immutable reference in CodegenTests

1 participant