-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
A user of the .NET global tool vsmac-cli reported the following host error when trying to use the tool after installing it.
% vsmac
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/vsmac-cli/0.2.0/vsmac-cli/0.2.0/tools/net5.0/any/].
If this is a framework-dependent application, install the runtime in the global location [/usr/local/share/dotnet/x64] 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.3
This error occurred because the app is framework dependent and the end user does not have the required framework installed. This is likely a common scenario for end users, yet the message is needlessly complex, with implementation details (libhostfxr) and irrelevant information (self-contained vs shared) that appears to be targeted at the developer of the app. This provided URL also appears to be incorrect, as the app's manifest does not allow it to be run with 6.x.
I would suggest that the error be more specifically targeted at helping end users understand the problem and resolve it e.g. something like
This application depends on version 5.0.x of the shared .NET runtime, which is not installed on this machine.
The latest compatible version of the runtime can be found at https://aka.ms/dotnet-runtime?version=5.0&rollforward=minor&rid=osx.12-x64
Perhaps dotnet-tool could also detect the missing runtime and prompt users to install it upfront when installing the tool.