1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

macのdotnet用環境変数設定

Last updated at Posted at 2021-02-18

macでhttpreplが使えない

macにhomebrewでdotnetをインストールして使っていましたが、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/XXXXXXX/.dotnet/tools/.store/microsoft.dotnet-httprepl/5.0.2/microsoft.dotnet-httprepl/5.0.2/tools/netcoreapp3.1/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/install_location].

ライブラリが見つからないらしい & /usr/local/share/dotnetは存在しない、のでDOTNET_ROOTを設定することで対応したい。ライブラリ自体は存在しているのは確認済み。

環境変数

というわけで、下記の1行目のように DOTNET_ROOTにdotnetのlibexecディレクトリを設定して無事に動作。

.zprofile
# .NET Core SDK tools
export DOTNET_ROOT=/usr/local/opt/dotnet/
export PATH="$PATH:$HOME/.dotnet/tools
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?