Make the new SdkResolver set the proper DOTNET_HOST_PATH env var instead of the non-functional DOTNET_HOST env var#2592
Merged
marcpopMSFT merged 1 commit intorelease/10.0.1xx-rc2from Sep 24, 2025
Conversation
d24f28c to
4ddee4c
Compare
92cfa8a to
4ddee4c
Compare
rainersigwald
approved these changes
Sep 24, 2025
Member
rainersigwald
left a comment
There was a problem hiding this comment.
Applied these privates over a canary-channel VS and was able to build a MAUI project using the right csc/vbcscompiler.
cc @jjonescz
Member
Author
|
Approved for RC2 over email. |
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.
Customer Impact
There isn't any observable customer impact to this change. This fixes an implementation issue in the previous MSBuild decoupling work that was being hidden by separate MSBuild engine compatibility shims that we added to enable testing the end-to-end of the feature before dev18 was available. If we don't take this change then the net impact is that we aren't able to remove our compat shim in the future and test/rely on the actual designed feature.
If we don't take this for RC2 we wouldn't push for this change, or the compat shim removal, for GA at all. We'd wait until a later feature band/VS release to coordinate that removal more safely.
Description
The SdkResolver is intended to set DOTNET_HOST_PATH to signal to MSBuild Tasks that need a .NET binary/runtime where to look for that binary. Instead it was setting DOTNET_HOST. This has no impact at all - we should have been setting DOTNET_HOST_PATH the whole time (once we added env var support at all in dotnet/sdk#50091).
This was masked because we put a compat shim in the MSBuild engine that looked for the
DOTNET_EXPERIMENTAL_HOST_PATHProperty set by an SdkResolver and transparently 'promoted' it to the DOTNET_HOST_PATH env var.After this change, both the experimental property and the correct env var will be set, but the engine prefers the env var if it is present.
Risk
Low - even with this change we will continue to set the back-compat property, this just enables us to remove the compat code some time in the future without breaking the world.
Testing
It's hard to test the env-var setting right now because the automated tests run in a CI-driven VS environment where the SdkResolver doesn't have the ability to set environment variables (which is why we made the compatibility shim in the first place). We're waiting on dev18 images to be available before we can truly pin this behavior through testing. @rainersigwald has done some end-to-end testing as well.