backport(8.0): Fix runtime architecture detection logic in ANCM#63706
Merged
joperezr merged 1 commit intorelease/8.0from Sep 19, 2025
Merged
backport(8.0): Fix runtime architecture detection logic in ANCM#63706joperezr merged 1 commit intorelease/8.0from
joperezr merged 1 commit intorelease/8.0from
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR backports a fix for runtime architecture detection logic in the ASP.NET Core Module (ANCM) to the .NET 8.0 branch. The changes replace a simple x86/x64 bitness check with comprehensive processor architecture detection that supports x86, AMD64, and ARM64 architectures.
Key changes:
- Introduces a new
ProcessorArchitectureenum with proper architecture detection - Replaces binary bitness checking with PE header machine type analysis
- Updates dotnet.exe selection logic to match process architecture instead of just bitness
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ProcessorArchitecture.h | New header defining processor architecture enum and string conversion utility |
| HostFxrResolver.h | Updates method signature from IsX64 to GetFileProcessorArchitecture and adds include |
| HostFxrResolver.cpp | Replaces bitness detection with comprehensive architecture matching using PE header analysis |
| Environment.h | Adds new method declaration for getting current process architecture |
| Environment.cpp | Implements compile-time architecture detection for current process |
danmoseley
approved these changes
Sep 17, 2025
Member
|
@DeagleGross feel free to send the usual mail to tactics for the backport approval. Note -- there is some precedent for holding off on backports until they've had some bake time in main. Or even, take the 9.0 backport but delay the 8.0 backport a month or two. It's really a risk decision. Your judgement. |
This was referenced Oct 15, 2025
Closed
This was referenced Feb 18, 2026
Closed
Closed
Closed
Closed
Bump the nuget-production-dependencies group with 22 updates
Mide69/Open-Telementry-project-demo#115
Closed
Closed
Closed
Open
Open
Open
Bump the nuget-production-dependencies group with 23 updates
PraveenKumarDova/opentelemetry-demo#124
Open
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.
Description
Backport of #63652 to net8.0
A change (#61894) improved algorithm to determine the architecture of a binary by switching away from
GetBinaryTypeW(which seems to load the exe into executable space which might trigger custom windows policies). It was backported to net8.0: #62037.However, we spotted that sometimes function incorrectly chooses a binary of an incompatible architecture, resulting in crashing site load.
Current change specifically checks for a full compatibility of bitness and architecture.
Fixes #63650
Customer Impact
For example users hosting x86 app on x64 machine / x64 app on arm64 machine are impacted unless current change is merged and used.
Regression?
Risk
Impacts users who are using different process architecture then what
where.exeoutputs trying to find dotnet binary. It takes OS / process / dotnet arch installed combination to affect the behavior.Verification
Packaging changes reviewed?