-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Setting DOTNET_HOST_PATH is not a good move :) #123
Comments
I think |
One hurdle here is that the .NET SDK doesn't forward any of the environment variables we look for on to local or global tools, like it does for other commands. It might be good to advocate for that feature, because as it stands, tools have no consistent way to detect the dotnet installation that's running them. |
Talking with some of the SDK team, the DOTNET_ROOT variable is only set if the install location isn't one of the well-known ones. So we should do probing if there's no DOTNET_ROOT. |
The final algorithm should look something like:
|
@dsyme this was released in 0.55.1 |
@dsyme ok, 0.55.2 has a more sane strategy that doesn't touch DOTNET_HOST_PATH |
ProjInfo sets DOTNET_HOST_PATH to an invalid value (the name of the currently executing program) when being run inside a .NET tool (e.g.
fsdocs.exe
rather thandotnet.exe
) hereproj-info/src/Ionide.ProjInfo/Library.fs
Line 168 in 6a6bdf3
This is because the default logic for
dotnetPath
assumes the current process isdotnet.exe
but for a tool host likefsdocs.exe
it isn't run bydotnet.exe
, e.g.proj-info/src/Ionide.ProjInfo/Utils.fs
Line 39 in 6a6bdf3
In any case, the setting of
DOTNET_HOST_PATH
should be strongly protected by a try/finally? If used at all?(Setting
DOTNET_HOST_PATH
to an invalid value confuses the heck out of FSharp.Compiler.Service.dll )The text was updated successfully, but these errors were encountered: