Skip to content

Conversation

@SimaTian
Copy link

@SimaTian SimaTian commented Jan 7, 2026

Bug

Fixes: dotnet/msbuild#12580

Description

When running the reproduction as described in the linked issue, the first time around the build fails due to a file being locked.
This is an attempt to remedy the issue by only running the target in the inner build. This is consistent with how _PackAsBuildAfterTarget already handles the GeneratePackageOnBuild scenario (lines 164-165):

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@SimaTian SimaTian requested a review from a team as a code owner January 7, 2026 09:30
@SimaTian SimaTian requested review from jeffkl and zivkan January 7, 2026 09:30
@dotnet-policy-service dotnet-policy-service bot added the Community PRs created by someone not in the NuGet team label Jan 7, 2026
/// when trying to write to the same .nupkg file.
/// </summary>
[PlatformFact(Platform.Windows)]
public void PackCommand_MultiTargetedProject_WithGraphMode_Succeeds()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you able to verify that without your fix that the test fails?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a local verification, but it is surprisingly annoying to get it to fail in the integration tests.
work in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community PRs created by someone not in the NuGet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled exception in server + graph scenario

2 participants