question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

runtime is missing in global location

See original GitHub issue

Describe the bug

After installing httprepl, running $httprepl or $dotnet httprepl is failing.

To Reproduce

Install dotnet via brew and httprepl via $dotnet tool install -g Microsoft.dotnet-httprepl. Try running httprepl as described above.

Exceptions (if any)

$httprepl 
A fatal error occurred. The required library libhostfxr.dylib could not be found.
If this is a self-contained application, that library should exist in [/Users/user/.dotnet/tools/.store/microsoft.dotnet-httprepl/6.0.0/microsoft.dotnet-httprepl/6.0.0/tools/net6.0/any/].
If this is a framework-dependent application, install the runtime in the global location [/usr/local/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].

The .NET runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=osx.12-x64&apphost_version=6.0.4
  - 
$dotnet httprepl
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-httprepl does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

$echo $PATH
/somevaild/.dotnet/tools /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/TeX/texbin 

Further technical details

$dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.104
 Commit:    915d644e45

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.4
 OS Platform: Darwin
 RID:         osx.12-x64
 Base Path:   /usr/local/Cellar/dotnet/6.0.104_1/libexec/sdk/6.0.104/

Host (useful for support):
  Version: 6.0.4
  Commit:  be98e88c76

.NET SDKs installed:
  6.0.104 [/usr/local/Cellar/dotnet/6.0.104_1/libexec/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.4 [/usr/local/Cellar/dotnet/6.0.104_1/libexec/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.4 [/usr/local/Cellar/dotnet/6.0.104_1/libexec/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vitek-karascommented, Jun 29, 2022

This feels like something didn’t work correctly in the brew install of .NET. Per the dotnet --info the install is located in /usr/local/Cellar/dotnet/6.0.104_1/libexec, but based on the errors it’s not registered. So apphost won’t be able to find it since it’s not on the default path nor is it registered.

I don’t have a mac at hand to try this - to verify that brew is not doing the right thing here. @joeloff could you please check on this? I assume we don’t own the brew .NET package, right?

A workaround is either:

  • Manually register the install by putting the path to it into /etc/dotnet/install_location_x64 (that file should be a text file with just the path to the .NET install in it on the first line)
  • Set DOTNET_ROOT environment variable to the path of the .NET install.

For those interested, details on how the install location works and what is used to find it are here: https://github.com/dotnet/designs/blob/main/accepted/2021/install-location-per-architecture.md

0reactions
GyroJoecommented, Mar 8, 2023

The Formula mentions this, but you need to set DOTNET_ROOT properly: export DOTNET_ROOT="$HOMEBREW_PREFIX/opt/dotnet/libexec"

Here’s the hosts.txt output without this for completeness:

Tracing enabled @ Wed Mar  8 00:53:35 2023 UTC
--- Invoked apphost [version: 7.0.0, commit hash: d099f075e45d2aa6007a22b71b45a08758559f80] main = {
authcore
}
The managed DLL bound to this executable is: '.store/authenticatorcore/0.1.0-ci-20230308-004036/authenticatorcore/0.1.0-CI-20230308-004036/tools/net7.0/any/AuthenticatorCore.dll'
Looking for architecture-specific install_location file in '/etc/dotnet/install_location_arm64'.
Found registered install location '/usr/local/share/dotnet'.
Using global installation location [/usr/local/share/dotnet] as runtime location.
The required library libhostfxr.dylib could not be found. Searched with root path [/Users/joeflint/.dotnet/tools/.store/authenticatorcore/0.1.0-ci-20230308-004036/authenticatorcore/0.1.0-ci-20230308-004036/tools/net7.0/any/], environment variable [DOTNET_ROOT], default install location [/usr/local/share/dotnet], self-registered config location [/etc/dotnet/install_location_arm64]
You must install .NET to run this application.

App: /Users/joeflint/.dotnet/tools/authcore
Architecture: arm64
App host version: 7.0.0
.NET location: Not found

Learn about runtime installation:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=arm64&rid=osx.13-arm64&apphost_version=7.0.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft Visual C++ 2022 X86 Minimum Runtime
Microsoft Visual C++ 2022 X86 Minimum Runtime - 14.32.31326 missing. I've been getting this for a while but the folder doesn't exist in...
Read more >
A fatal error occurred. The required library hostfxr.dll could ...
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT ...
Read more >
[java] New launcher has missing Java Runtime?
It seems like it was located in "C:\Users\{yourusernamehere}\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\ ...
Read more >
Missing hostfxr.dll (.NET Core Runtime) When Creating a ...
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT ...
Read more >
ArcGIS pro Requires Microsoft .NET Desktop Runtime (X64)
When updating ArcGIS Pro to version 3.0.0, the following error is returned: Error: ArcGIS Pro requires Microsoft .NET Desktop Runtime (x64).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found