Skip to content

Allow multiple 'PackageDownload' MSBuild items for the same package, different versions #15167

Backlog

Description

@svew

NuGet Product(s) Affected

MSBuild.exe

Current Behavior

Currently, if I want to restore two versions of the same package using 'PackageDownload', I have to write the item like this:

<PackageDownload Include="VisualStudio.UnitTest.Corext" Version="[11.0.1];[10.0.0]" />

I would like to write the same thing in this style instead:

<GlobalPackage Include="VisualStudio.UnitTest.Corext" Version="[11.0.1]" />
<GlobalPackage Include="VisualStudio.UnitTest.Corext" Version="[10.0.0]" />

However, this doesn't work, only the first package version is downloaded, and the below warning is emitted:

warning NU1505: Duplicate 'PackageDownload' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageDownload' items are: VisualStudio.UnitTest.Corext [11.0.1], VisualStudio.UnitTest.Corext [10.0.0].

Desired Behavior

I would like the ability to break up multiple versions of the same PackageDownload item into multiple items.

This formatting would have a few upsides:

  1. It's easier to visually pick up that there are multiple versions of the same package
  2. It would help support 'GeneratePathProperty' does not work on 'PackageDownload' #8476, which is not yet implemented, but our team needs, so we're forced to roll a custom solution for both that issue and this issue

Additional Context

No response

Activity

  1. added
    Type:DCR
    on Dec 3, 2026
  2. changed the title [-]Allow multiple 'PackageDownload' items for the same package, with different versions[/-] [+]Allow multiple 'PackageDownload' MSBuild items for the same package, different versions[/+] on Dec 3, 2026
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

    Triage:UntriagedType:DCR

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions