'.NET Live Share issue: Agent terminated with exit code: 0 and signal null: A fatal error occurred. The required library hostfxr.dll could not be found

I am trying to use the VSCode Live Share extension from Microsoft, but everytime it tries to start this error is thrown:

[2022-01-26 21:23:06.492] [exthost] [error] Error: Agent terminated with exit code: 0 and signal null: 
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\Leonardo\.vscode\extensions\ms-vsliveshare.vsliveshare-1.0.5273\dotnet_modules\].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files (x86)\dotnet] or use the DOTNET_ROOT(x86) environment variableto specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation].The .NET Core runtime can be found at:
  -https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x86&rid=win81-x86
    at ChildProcess.<anonymous> (c:\Users\Leonardo\.vscode\extensions\ms-vsliveshare.vsliveshare-1.0.5273\src\abstractions\node\agent.ts:291:32)
    at ChildProcess.emit (events.js:327:22)
    at maybeClose (internal/child_process.js:1048:16)
    at Socket.<anonymous> (internal/child_process.js:439:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:673:12)

I have .NET Runtime and SDK installed, also using dotnet into terminal works fine. The DOTNET_ROOT environment variable is set to the same thing as which dotnet returns.

Any ideas on this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source