Fresh clone build fails due to duplicate package reference
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- build-system
Research direction
Open src/WinGet.RestSource.Utils/WinGet.RestSource.Utils.csproj and inspect the Microsoft.WindowsPackageManager.Utils PackageReference entries shown in the issue. Build the solution in Visual Studio 2022 from a fresh checkout to confirm the NU1504 error. Done means the duplicate reference is gone and the solution builds successfully.
Written by the indexing model from the issue text.
Description
Brief description of your issue
This is different than the issue in #148, but the issue I'm experiencing was reported in part in the comments by @hancockl.
I'm internal to Microsoft so I'm not running into the package source permission issue, but I am running into a problem where when I try to open the solution in Visual Studio 2022, the build fails due to this error:
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.WindowsPackageManager.Utils 0.3.4, Microsoft.WindowsPackageManager.Utils *. WinGet.RestSource.Utils C:\src\winget-cli-restsource\src\WinGet.RestSource.Utils\WinGet.RestSource.Utils.csproj 1
In WinGet.RestSource.Utils.csproj, there are indeed duplicate PackageReference items for Microsoft.WindowsPackageManager.Utils (link):
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.22.0" />
<PackageReference Include="Microsoft.WindowsPackageManager.Utils" Version="0.3.4" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" />
<PackageReference Include="Microsoft.WindowsPackageManager.Utils" Version="*" />
</ItemGroup>
Deleting either of the two Microsoft.WindowsPackageManager.Utils PackageReferences elements appears to be adequate for the build to complete.
Steps to reproduce
Fresh clone of repo, attempt to build .sln in Visual Studio
Expected behavior
Works
Actual behavior
Doesn't work
Environment
Windows 10
Visual Studio 2022
- Dominant language
- C#
- Stars
- 317
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/winget-cli-restsource
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Issue-Feature
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Font Support OpenIssue-Feature
microsoft/winget-cli-restsource#310 · 1 comment · 1 assignee ·
-
Issue-Bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/winget-cli-restsource#309 · 2 comments ·
All issues in microsoft/winget-cli-restsource
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·