Skip to content

SdkResolver may need to set DOTNET_ROOT in order for framework-dependent processes inside an IDE to run correctly #49825

@baronfel

Description

@baronfel

Is your feature request related to a problem? Please describe.

@MiYanni found this while testing the .NET TaskHost on a preview build of VS. While this version of VS can use the global.json sdk.paths feature to locate SDK roots correctly, and while this version of VS does set the DOTNET_EXPERIMENTAL_HOST_PATH property (soon to be env var) to enable the use of the .NET TaskHost, there are still standalone .NET executables that are produced during the normal flow of development, like testhost.exe. In the SDK repo, tests in VS weren't running because the testhost.exe produced during the build of test projects couldn't resolve a preview7 runtime.

Setting DOTNET_ROOT to <repo_root>/.dotnet before launching VS enabled those testhost.exe binaries to launch.
The SkdResolver may need to set this property/environment variable as well in order for VS environments to maintain parity with CLI experiences.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions