Skip to content

Suppress MSB3026 warnings#65671

Merged
wtgodbe merged 1 commit into
mainfrom
wtgodbe/MSB3026
Mar 6, 2026
Merged

Suppress MSB3026 warnings#65671
wtgodbe merged 1 commit into
mainfrom
wtgodbe/MSB3026

Conversation

@wtgodbe
Copy link
Copy Markdown
Member

@wtgodbe wtgodbe commented Mar 5, 2026

MSBuild logs a copy failure as MSB3026, and then retries. We often see this surface as:

D:\a_work\1\s.dotnet\sdk\11.0.100-preview.1.26104.118\Microsoft.Common.CurrentVersion.targets(5094,5): error MSB3026: Could not copy "D:\a_work\1\s\artifacts\bin\Microsoft.AspNetCore.Hosting.Abstractions\Release\net11.0\Microsoft.AspNetCore.Hosting.Abstractions.xml" to "D:\a_work\1\s\artifacts\bin\AzureAppServicesHostingStartupSample\Release\net11.0\Microsoft.AspNetCore.Hosting.Abstractions.xml". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a_work\1\s\artifacts\bin\Microsoft.AspNetCore.Hosting.Abstractions\Release\net11.0\Microsoft.AspNetCore.Hosting.Abstractions.xml' because it is being used by another process. [D:\a_work\1\s\src\Azure\samples\AzureAppServicesHostingStartupSample\AzureAppServicesHostingStartupSample.csproj]

The build then retries the copy, and it usually succeeds, but CI still reports red due to MSB3026. We can NoWarn it, since a subsequent copy failure in the retry gets logged as a different warning (MSB3021), so the build will still correctly fail in those cases.

Copilot AI review requested due to automatic review settings March 5, 2026 23:57
@github-actions github-actions Bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Mar 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repo-wide build configuration to prevent transient MSBuild copy-retry warnings (MSB3026) from failing CI when /warnaserror is enabled (as it is in CI builds).

Changes:

  • Demote MSB3026 from warning/error to message level via MSBuildWarningsAsMessages so retry-attempt noise does not fail builds.
  • Document the rationale inline in Directory.Build.props.

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Mar 6, 2026

/backport to release/10.0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

Started backporting to release/10.0 (link to workflow run)

@wtgodbe wtgodbe merged commit 708d724 into main Mar 6, 2026
31 checks passed
@wtgodbe wtgodbe deleted the wtgodbe/MSB3026 branch March 6, 2026 02:40
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview3 milestone Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants