Repository navigation
Add Architecture="*" to Runtime="NET" UsingTask declarations to fix MSB4216 on x86 MSBuild - #16790
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix MSB4216 by adding Architecture attribute to UsingTask
Add Architecture="*" to Runtime="NET" UsingTask declarations to fix MSB4216 on x86 MSBuild
May 12, 2026
Member
|
@copilot add TODO markers to remove the Architecture attribute when dotnet/msbuild#13739 is fixed and a new msbuild is consumed with the fix. |
Contributor
Author
Added a TODO comment referencing dotnet/msbuild#13739 above the first |
ViktorHofer
approved these changes
May 12, 2026
ViktorHofer
marked this pull request as ready for review
May 12, 2026 10:17
ViktorHofer
enabled auto-merge (squash)
May 12, 2026 10:17
ViktorHofer
added a commit
to dotnet/sdk
that referenced
this pull request
May 12, 2026
…#13739 Mirrors the marker requested on dotnet/arcade#16790 so the workaround can be removed once MSBuild fixes its host-architecture default for Runtime="NET". Co-authored-by: Copilot <[email protected]>
JanProvaznik
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<UsingTask Runtime="NET">without anArchitectureattribute defaults to the host MSBuild's architecture. Under x86 Full Framework MSBuild (e.g. VS 18 Insiders' defaultMSBuild.exe), MSBuild then looks for an x86MSBuild.exein the .NET SDK, which doesn't exist (SDK ships x64/arm64 only), producing MSB4216.Setting
Architecture="*"lets MSBuild pick any available task host architecture.Architecture="*"to all 129<UsingTask>entries withRuntime="NET"across 31.props/.targetsfiles undersrc/(including all files called out in the issue, plus other Arcade SDKs that share the same pattern:Microsoft.DotNet.Build.Tasks.Packaging,Microsoft.DotNet.Build.Tasks.Feed,Microsoft.DotNet.Build.Tasks.TargetFramework,Microsoft.DotNet.GenFacades,Microsoft.DotNet.GenAPI,Microsoft.DotNet.XliffTasks,Microsoft.DotNet.CMake.Sdk,Microsoft.DotNet.Baselines.Tasks,Microsoft.DotNet.SwaggerGenerator.MSBuild, and a few.targetsunderMicrosoft.DotNet.Arcade.SdkandMicrosoft.DotNet.Build.Tasks.Installers).Runtime="NET"<UsingTask>in each of the 31 modified files referencing MSB4216 when x86 Full Framework MSBuild hosts Arcade SDK tasks with Runtime=NET msbuild#13739, so theArchitecture="*"attribute can be removed once a fixed msbuild is consumed.Runtime="NET"were left untouched.Example of the change:
To double check: