Analyzer test restore reports duplicate Microsoft.NETCore.App.Ref PackageDownload items

Open Beginner friendly
#7,585 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
73/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
build-system

Research direction

Start with eng/AnalyzerTestReferencePacks.props:20, then inspect the analyzer test project’s restore settings and reproduce with dotnet restore tests/TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj. The change is done when restore no longer reports NU1505 for duplicate Microsoft.NETCore.App.Ref PackageDownload items and the versions needed by analyzer tests remain available.

Written by the indexing model from the issue text.

Description

bug P3

Summary

Restoring the analyzer test project reports NU1505 because Microsoft.NETCore.App.Ref appears in multiple PackageDownload items. The explicit reference-pack downloads should coexist with SDK target-framework downloads without duplicate restore warnings.

Reproduction

Run dotnet restore tests/TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj with SDK 10.0.403 on macOS arm64 at commit 885ee5f799.

Expected and actual

Expected: no duplicate PackageDownload warning. Actual: NU1505 reports Microsoft.NETCore.App.Ref [8.0.0];[9.0.0];[10.0.0] alongside [8.0.33] for net8.0 and [9.0.22] for net9.0. The explicit multi-version item is in eng/AnalyzerTestReferencePacks.props:20; the target-framework-specific versions are supplied by the SDK.

Environment

.NET SDK 10.0.403, macOS arm64, main at 885ee5f799. Found while validating #7572. Please combine the reference-pack downloads without producing duplicate PackageDownload items, retaining the versions needed by analyzer tests.

Dominant language
C#
Stars
4k
Forks
139
Avg merge
7h 35m
Merged PRs (30d)
374

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from thomhurst/TUnit

All issues in thomhurst/TUnit

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.