Making .NET Core Global Tools Work With OhMyZsh

Written by Khalid Abuhakmeh

I was trying to get a global .NET Core tool working on my development machine, which just so happens to be running macOS. I also work with OhMyZsh inside of iTerm2. Every time I would invoke the global tool I would get the following error:

➜ dotnet-project-licenses --help
zsh: command not found: dotnet-project-licenses

To fix this problem, I had to make sure that the .dotnet/tools directory was exported into my path. I can fix that by modifying my ~/.zshrc file with the following lines.

# dotnet global tools
export PATH="$PATH:$HOME/.dotnet/tools"

After restarting my terminal window, I was able to access all the .NET global tools I had installed. I hope this helps.

Published March 07, 2019 by

undefined avatar
Khalid Abuhakmeh Director of Software Development (Former)

Suggested Reading