Skip to content

Fix hostfxr probing path for musl-based runtimes#75

Merged
baronfel merged 3 commits intodotnet:mainfrom
MattKotsenas:bugfix/hostfxr-resolution
Jan 27, 2026
Merged

Fix hostfxr probing path for musl-based runtimes#75
baronfel merged 3 commits intodotnet:mainfrom
MattKotsenas:bugfix/hostfxr-resolution

Conversation

@MattKotsenas
Copy link
Member

Fixes #74

Alpine puts the hostfxr in a path that isn't probed by default. Fix that by creatuing HostFxrResolver and using AssemblyLoadContext.ResolvingUnmanagedDll like MSBuildLocator does. In order to access the required APIs, I moved from netstandard2.0 to multi-targeting and make the assumption that netfx will always be run on Windows.

To catch the issue and prevent future regressions, added Alpine and Ubuntu tests (using Docker) to the PR build.

@MattKotsenas MattKotsenas requested a review from a team as a code owner January 27, 2026 18:18
@baronfel
Copy link
Member

Totally agree with with the following:

netfx will always be run on Windows

Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

Love to see it - thanks for tackling this.

@baronfel baronfel merged commit 668901e into dotnet:main Jan 27, 2026
5 checks passed
@MattKotsenas MattKotsenas deleted the bugfix/hostfxr-resolution branch January 27, 2026 21:19
This was referenced Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DotNet.ReproducibleBuilds.Isolated 2.0.1 breaks builds using Alpine based SDK image

2 participants