-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
DOTNET_ROOT does not work as the doc says. #64244
Comments
Related codes: https://github.com/dotnet/runtime/blob/v6.0.1/src/native/corehost/fxr_resolver.cpp#L55
It detects the |
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsDescriptionThis document below says that the
Reproduction StepsPrepare#1
Prepare#2
Reproduction
Expected behaviorThe output exe can run successfully. Actual behaviorThe output exe still prints the .NET Runtime error message. But it runs successfully if we copy the dotnet runtime folder to its default location. This means that the Regression?It doesn't work properly either on .NET 6.0 or on .NET 5.0. Known WorkaroundsI have no workaround currently and waiting for one to customize the dotnet root directory. What I need is to share the dotnet runtime among multiple exes targeting the same version of .NET 6.0 in a single solution but ignoring the system installed one which is often affected by some other software. ConfigurationNo response Other informationNo response
|
Can you please try to collect host traces when it fails: set COREHOST_TRACE=1
set COREHOST_TRACEFILE=host.txt
<run the app an let it fail> Note that the produced The traces will contain detailed information on why the host decided to probe a specific directory, if it actually read an env. variable and so on. |
@vitek-karas Thank you for your suggestions and I get the host.txt file to find out the issue I've met. The key reason is that:
After I use the cmd instead, the .NET 6.0 application runs successfully. |
Description
This document below says that the
DOTNET_ROOT
environment variables can be set for the AppHost to determine the .NET Runtime. But I've tested that it does not work.Reproduction Steps
Prepare#1
Prepare#2
C:\Program Files\dotnet
to any place outside the virtual machine.Reproduction
C:\Users\walterlv\Desktop\dotnet
.DOTNET_ROOT
to point to the new runtime directory.Expected behavior
The output exe can run successfully.
Actual behavior
The output exe still prints the .NET Runtime error message. But it runs successfully if we copy the dotnet runtime folder to its default location. This means that the
DOTNET_ROOT
seems not to work.Regression?
It doesn't work properly either on .NET 6.0 or on .NET 5.0.
Known Workarounds
I have no workaround currently and waiting for one to customize the dotnet root directory.
What I need is to share the dotnet runtime among multiple exes targeting the same version of .NET 6.0 in a single solution but ignoring the system installed one which is often affected by some other software.
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: