Skip to content

Add environment variable support to SDK resolvers #12023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

baronfel
Copy link
Member

@baronfel baronfel commented Jun 16, 2025

Enable dotnet/roslyn#78939 by adding the ability for SDK resolvers to return environment variables.

The environment variables are set during execution, because they cannot be reliably set during evaluation, which may be happening concurrently within a process. The value is also set as a regular property for ease of access during evaluation time.

@rainersigwald rainersigwald self-assigned this Jun 16, 2025
@rainersigwald rainersigwald changed the title Draft PR of adding environment variable support to SdkResolvers Add environment variable support to SDK resolvers Jun 27, 2025
@rainersigwald rainersigwald requested a review from surayya-MS June 27, 2025 21:20
@baronfel baronfel marked this pull request as ready for review June 27, 2025 21:26
@rainersigwald
Copy link
Member

Ok the logging is Not Quite Right™️:

image

Copy link
Member

@surayya-MS surayya-MS left a comment

Choose a reason for hiding this comment

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

Overall looks good to me!

For logging maybe only log success message "SdkEnvironmentVariableSet" because there would be a lot of repetitions of messages like above. Haven't thought of a better way.

@baronfel , @rainersigwald is my understanding correct that next steps are the following?

  1. merge #12077, so that DOTNET_HOST_PATH would be set from property DOTNET_EXPERIMENTAL_HOST_PATH
  2. Modify the MSBuildSdkResolver by removing DOTNET_EXPERIMENTAL_HOST_PATH and adding env var DOTNET_HOST_PATH to SdkResult
  3. Revert #12077

@surayya-MS surayya-MS self-assigned this Jun 30, 2025
@baronfel
Copy link
Member Author

@surayya-MS exactly!

@rainersigwald
Copy link
Member

rainersigwald commented Jul 1, 2025

We should probably make the requirement for 3 explicit:

2.5. Wait until that SDK resolver is inserted into VS int preview.

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.

4 participants