What really solved in my case:
sudo ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
after this command, go to ~/.zshrc
nano ~/.zshrc
And add followings:
Keys to save and exit editor: Ctrl+x, Y, Enter
After that, it will definitely work.