Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While debugging "Duplicate 'PackageDownload' items found." MSBuild throws "Unhandled Exception: Microsoft.Build.Framework.InternalErrorException" #7739

Closed
rakitaj opened this issue Jun 24, 2022 · 2 comments
Labels
bug needs-triage Have yet to determine what bucket this goes in.

Comments

@rakitaj
Copy link

rakitaj commented Jun 24, 2022

Issue Description

When attempting to msbuild /t:SlnGen dirs.proj for my repo I’m getting an error about duplicate PackageDownload items that look like they’re the .Net Core SDK packages? I’m trying to get more info and used the /pp:out.xml switch. When that didn’t help, I figured I would get the diagnostic verbosity logs. That’s when I ran the command below and MSBuild crashed.

I don't think the problem I'm trying to debug is related to getting MSBuild to crash when asking for diagnostic output but I want to be complete so I'm including it:
C:\Users\joraki\OneBranch\$repoName\src\tools\DeploymentDatasetGenerator\DeploymentDatasetGenerator.csproj: error 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: Microsoft.WindowsDesktop.App.Runtime.win-x64 [3.1.26], Microsoft.WindowsDesktop.App.Runtime.win-x64 [3.1.26], Microsoft.WindowsDesktop.App.Runtime.win-x64 [3.1.26].

Steps to Reproduce

MSBuild Version

❯ msbuild /version
Microsoft (R) Build Engine version 17.3.0-preview-22277-01+f1dae6ab6 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

17.3.0.27701

Command

msbuild /verbosity:diag C:\Users\joraki\OneBranch\$repoName\src\tools\DeploymentDatasetGenerator\DeploymentDatasetGenerator.csproj

Expected Behavior

Diagnostic level output from building that csproj.

Actual Behavior

Short stack trace

Some command line switches were read from the auto-response file "MSBuild.rsp". To disable this file, use the "-noAutoResponse" switch. C:\Program Files\Microsoft Visual Studio\2022\Preview\\MSBuild\Current\Bin\amd64\MSBuild.exe /ConsoleLoggerParameters:Verbosity=Minimal;ForceNoAlign;Summary /M /Restore /verbosity:diag C:\Users\joraki\OneBranch\$repoName\src\tools\DeploymentDatasetGenerator\DeploymentDatasetGenerator.csproj MSBUILD : error MSB1025: An internal failure occurred while running MSBuild. Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Cannot have finished counter without started counter.

Long stack trace

msbuild-stacktrace.txt

Analysis

I don't know.

Versions & Configurations

I'm building from the command line but in case it matters:

  • Windows Terminal
  • Shell: PowerShell Core 7.2.1
  • Windows 10: winver == 19044.1766
  • Visual Studio 2022 Enterprise 17.3.0 preview 2.0 NOTE: This is not from building inside Visual Studio

❯ msbuild /version
Microsoft (R) Build Engine version 17.3.0-preview-22277-01+f1dae6ab6 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

17.3.0.27701

@rakitaj rakitaj added bug needs-triage Have yet to determine what bucket this goes in. labels Jun 24, 2022
@rainersigwald
Copy link
Member

I believe this will be fixed in the next .NET SDK preview (which will ship with the next VS preview). There are some workarounds at dotnet/sdk#24747 (comment).

@rainersigwald
Copy link
Member

Duplicate of dotnet/sdk#24747

@rainersigwald rainersigwald marked this as a duplicate of dotnet/sdk#24747 Jun 24, 2022
@rainersigwald rainersigwald closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

No branches or pull requests

2 participants