Skip to content

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

Open

Description

@thomhurst

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.

Activity

  1. added
    bugSomething isn't working
    P3Low: cleanup, minor enhancement, or rare edge case
    on Nov 4, 2026
  2. thomhurst commented on Nov 4, 2026

    @thomhurst
    OwnerAuthor

    Triaged against origin/main at 885ee5f: the explicit Microsoft.NETCore.App.Ref multi-version PackageDownload remains in eng/AnalyzerTestReferencePacks.props and is imported by the analyzer test project. #7586 reports this warning but does not fix it. No native blockers or children; this issue remains available for implementation.

  3. thomhurst commented on Nov 5, 2026

    @thomhurst
    OwnerAuthor

    Reproduced while validating #7462 on main 5a18e53 with SDK 10.0.403: restoring tests/TUnit.Analyzers.Tests emits NU1505 for Microsoft.NETCore.App.Ref [8.0.0];[9.0.0];[10.0.0] alongside [8.0.33] and [9.0.22]. Expected: one PackageDownload declaration per package.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: cleanup, minor enhancement, or rare edge casebugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions