Skip to content

[Bug]: Items already exist for target Build. #9362

@AArnott

Description

@AArnott

Issue Description

A build hangs after printing this error:

MSBUILD : error : This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :     Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Items already exist for target Build. [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args) [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :    at Microsoft.Build.Execution.BuildResult.AddResultsForTarget(String target, TargetResult result) [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.<BuildProject>g__CopyTargetResultsFromProxyTargetsToRealTargets|68_0(BuildResult resultFromTargetBuilder) [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.<BuildProject>d__68.MoveNext() [C:\VS\src\version\versiongen.csproj]
MSBUILD : error : --- End of stack trace from previous location where exception was thrown --- [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [C:\VS\src\version\versiongen.csproj]
MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.<BuildAndReport>d__59.MoveNext() [C:\VS\src\version\versiongen.csproj]

Steps to Reproduce

In the root of the internal VS repo:

git checkout bedd09f618261f2294d911d6e6b64be20e197734
.\retail.ps1
bm src\Platform\Utilities\UnitTests /r

Expected Behavior

A build that succeeds, modulo a few build warnings.

Actual Behavior

After restore, the build fairly quickly emits the error in the issue description, plus a couple "Cache Hit" notices.
The build then appears to stall. It doesn't consume any more CPU or network, but it doesn't make any progress either, and the msbuild invocation at the CLI never exits.

The binlog.

Analysis

No response

Versions & Configurations

MSBuild version 17.9.0-preview-23519-03+221fd2e87 for .NET Framework

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triageHave yet to determine what bucket this goes in.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions