Csharpier fails on embeded .net versions without seting direct path to .net installation directory
Hello, I'm using embeded version of .net. Issue is if I don't set DOTNET_ROOT in user variables Csharpier is not discovering .net
dotnet csharpier --version A fatal error occurred. The required library hostfxr.dll could not be found. If this is a self-contained application, that library should exist in [C:\Users\ddebinski.dotnet\tools.store\csharpier\0.17.0\csharpier\0.17.0\tools\net6.0\any]. If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].
dotnet --version 6.0.403
But if I set DOTNET_ROOT then it works, but Omnisharp fails (mainly see same error when lunch test debuger, created other ticked (https://github.com/OmniSharp/omnisharp-vscode/issues/5533)) ....
How to reproduce? Delete all installed versions of .net, download embeded, setup needed local variables, install csharpier in vscode.
I think auto discovery could be improved.
Thanks
Thanks for the reproduction steps. I'm not exactly clear how to download an embedded version of dotnet. It isn't something I'm familiar with and my googling has failed me.
Thanks for the reproduction steps. I'm not exactly clear how to download an embedded version of dotnet. It isn't something I'm familiar with and my googling has failed me.
On download page https://dotnet.microsoft.com/en-us/download/dotnet/7.0 simply choose Binary version. then unzip, set .net path in your environment variable (to directory you unzipped .net), and run some project.
The latest version of the vscode extension should handle this now. It locates dotnet, and then sets DOTNET_ROOT when it runs csharpier. If it can't locate dotnet on the PATH, it respects the configurations dotnet.dotnetpath and omnisharp.dotNetCliPaths