简体   繁体   中英

Dotnet command not recognized after reboot Raspbian

I want to run my asp.net core application on Rasbpian buster OS on raspberry pi 3 B after reboot, but dotnet commad not recognized after reboot, and I face with this error [dotnet: command not found].

After I run these two lines of code on terminal the dotnet command can run correctly.

export DOTNET_ROOT=$HOME/dotnet 
export PATH=$PATH:$HOME/dotnet

You can see screenshot of my SSH connection through Putty to raspberry pi after reboot.

在此处输入图片说明

The PATH is a : -seperated list of every directory where files should be executable by just writing the name of the file in the command line. (You still need the x permission)

dotnet is not in your PATH .

The command export PATH=... changes the PATH for your current session.

If you want to have dotnet everytime on startup, create a symlink from /usr/bin/dotnet to $HOME/dotnet/dotnet :

sudo ln -s "$HOME/dotnet/dotnet" "/usr/bin/dotnet"

or add copy the command to the bottom of the $HOME/.bashrc file.

[ NOTE ]

If you don't have dotnet installed on $HOME/dotnet/ , you will need to change that directory in the ln command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM