Skip to content

Duplicate 'PackageReference' items found error when building in source-build #835

@MichaelSimons

Description

@MichaelSimons

The following error occurs when building sourcelink in source-build with the latest toolset

sourcelink/artifacts/source-build/self/src/src/Microsoft.Build.Tasks.Tfvc/Microsoft.Build.Tasks.Tfvc.csproj : error NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageReference' items are: Microsoft.Build 17.3.0-preview-22330-01, Microsoft.Build 17.3.0-preview-22330-01; Microsoft.Build.Tasks.Core 16.7.0, Microsoft.Build.Tasks.Core 16.7.0.

By looking at [Microsoft.Build.Tasks.Tfvc.csproj](https://github.com/dotnet/sourcelink/blob/main/src/Microsoft.Build.Tasks.Tfvc/Microsoft.Build.Tasks.Tfvc.csproj), you can clearly see the Microsoft.Build and Microsoft.Build.Tasks.Core PackageReferences are duplicated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions