question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`build.cmd` fails when latest int preview of dev17 is installed

See original GitHub issue

It builds fine from latest public VS2022 developer shell.

image

Build FAILED.

C:\Users\vlza\code\fsharp\vsintegration\src\FSharp.ProjectSystem.Base\FSharp.ProjectSystem.Base.csproj : error NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functi
onality to ensure a consistent restore behavior. The duplicate 'PackageReference' items are: Microsoft.VisualStudio.ProjectAggregator 17.0.0-previews-4-31709-430, Microsoft.VisualStudio.ProjectAggregator 17.0.0-p
reviews-4-31709-430.
C:\Users\vlza\code\fsharp\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj : 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.Framework 17.0.0, Microsoft.Build.Framework 17.0.0; System.Runtime.CompilerServices.Unsafe 5.0.0, System.Runtime.Compile
rServices.Unsafe 5.0.0; NUnit 3.13.2, NUnit 3.13.2.
C:\Users\vlza\code\fsharp\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj : 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.Framework 17.0.0, Microsoft.Build.Framework 17.0.0; System.Runtime.CompilerServices.Unsafe 5.0.0, System.Runtime.Compile
rServices.Unsafe 5.0.0; NUnit 3.13.2, NUnit 3.13.2.
C:\Users\vlza\code\fsharp\vsintegration\src\FSharp.ProjectSystem.PropertyPages\FSharp.ProjectSystem.PropertyPages.vbproj : 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: System.Reflection.Metadata 5.0.0, System.Reflection.Metadata 5.0.0.
C:\Users\vlza\code\fsharp\src\fsharp\fsi\fsi.fsproj : error NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. Th
e duplicate 'PackageReference' items are: System.Diagnostics.Process 4.3.0, System.Diagnostics.Process 4.3.0; System.Linq.Expressions 4.3.0, System.Linq.Expressions 4.3.0; System.Reflection.Emit 4.3.0, System.Ref
lection.Emit 4.3.0; System.Reflection.TypeExtensions 4.3.0, System.Reflection.TypeExtensions 4.3.0; System.Reflection.Metadata 5.0.0, System.Reflection.Metadata 5.0.0; System.Runtime.Loader 4.3.0, System.Runtime.
Loader 4.3.0; System.Security.Principal 4.3.0, System.Security.Principal 4.3.0; System.Threading.Thread 4.3.0, System.Threading.Thread 4.3.0.
C:\Users\vlza\code\fsharp\src\fsharp\fsi\fsi.fsproj : error NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. Th
e duplicate 'PackageReference' items are: System.Diagnostics.Process 4.3.0, System.Diagnostics.Process 4.3.0; System.Linq.Expressions 4.3.0, System.Linq.Expressions 4.3.0; System.Reflection.Emit 4.3.0, System.Ref
lection.Emit 4.3.0; System.Reflection.TypeExtensions 4.3.0, System.Reflection.TypeExtensions 4.3.0; System.Reflection.Metadata 5.0.0, System.Reflection.Metadata 5.0.0; System.Runtime.Loader 4.3.0, System.Runtime.
Loader 4.3.0; System.Security.Principal 4.3.0, System.Security.Principal 4.3.0; System.Threading.Thread 4.3.0, System.Threading.Thread 4.3.0.
C:\Users\vlza\code\fsharp\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj : 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.Framework 17.0.0, Microsoft.Build.Framework 17.0.0; System.Runtime.CompilerServices.Unsafe 5.0.0, System.Runtime.Compile
rServices.Unsafe 5.0.0; NUnit 3.13.2, NUnit 3.13.2.
C:\Users\vlza\code\fsharp\vsintegration\src\FSharp.ProjectSystem.PropertyPages\FSharp.ProjectSystem.PropertyPages.vbproj : 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: System.Reflection.Metadata 5.0.0, System.Reflection.Metadata 5.0.0.
C:\Users\vlza\code\fsharp\vsintegration\src\FSharp.ProjectSystem.Base\FSharp.ProjectSystem.Base.csproj : error NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functi
onality to ensure a consistent restore behavior. The duplicate 'PackageReference' items are: Microsoft.VisualStudio.ProjectAggregator 17.0.0-previews-4-31709-430, Microsoft.VisualStudio.ProjectAggregator 17.0.0-p
reviews-4-31709-430.
C:\Users\vlza\code\fsharp\src\fsharp\fsi\fsi.fsproj : error NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. Th
e duplicate 'PackageReference' items are: System.Diagnostics.Process 4.3.0, System.Diagnostics.Process 4.3.0; System.Linq.Expressions 4.3.0, System.Linq.Expressions 4.3.0; System.Reflection.Emit 4.3.0, System.Ref
lection.Emit 4.3.0; System.Reflection.TypeExtensions 4.3.0, System.Reflection.TypeExtensions 4.3.0; System.Reflection.Metadata 5.0.0, System.Reflection.Metadata 5.0.0; System.Runtime.Loader 4.3.0, System.Runtime.
Loader 4.3.0; System.Security.Principal 4.3.0, System.Security.Principal 4.3.0; System.Threading.Thread 4.3.0, System.Threading.Thread 4.3.0.
    0 Warning(s)
    10 Error(s)

Time Elapsed 00:03:34.67

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
baronfelcommented, Apr 26, 2022

We have this in the SDK itself, too - NuGet added some new features for detecting cycles in this spec. These particular errors are likely due to SDK targets, and we may incidentally end up fixing them as part of https://github.com/dotnet/sdk/issues/24747. I need to triage that one soon. As you can see from the linked SDK issue, tons of MS repos are disabling the warning until we fix it.

0reactions
baronfelcommented, May 4, 2022

Couple quick notes, will update as I see things:

  • System.Runtime.CompilerServices.Unsafe error is because of these two duplicate references, which should be consolidated
  • FSharp.ProjectSystem.Base.csproj does have duplicate PackageReference items for Microsoft.VisualStudio.ProjectAggregator, also an easy fix
  • VisualFSharp.UnitTests.fsproj are duplicate as well - both the fsproj and the vsintegration/Directory.Build.targets have the Microsoft.Build.Framework PackageReference in them. Possibly some build logic needs to change here on your part
    • the NoMsbuild condition doesn’t seem to be used anywhere - so I think these references are just universal
  • FSharp.ProjectSystem.PropertyPages.vbproj - same thing, duplicated PackageReferences between the project file and the vsintegration/Directory.Build.targets
  • Fsi.fsproj - duplicate packagereferences in the project file here too.
Read more comments on GitHub >

github_iconTop Results From Across the Web

devenv /build command line fails to build and shows usage
A fix for this issue is now available in preview release. Try out the fix by installing the most recent preview from https://visualstudio....
Read more >
Can no longer build from the command line in VS2022
I'm running Visual Studio Community 2022 and while I can compile just fine in the GUI, my DOS build script (which calls devenv.exe...
Read more >
The command "npm run build -- --prod" exited with code 1 ...
Open ClientApp folder and Update project angular-cli with this CMD command: npm install --save-dev @angular/cli@latest.
Read more >
Use command-line parameters to install Visual Studio
Learn how to use command-line parameters to control or customize your Visual Studio installation.
Read more >
How to fix a "Command not found" error in Linux
5 ways to fix "Command not found" errors · 1. Include the path · 2. Add a new path · 3. Copy a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found