简体   繁体   English

重启 Raspbian 后无法识别 Dotnet 命令

[英]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].我想在重新启动后在 raspberry pi 3 B 上的 Rasbpian buster OS 上运行我的 asp.net 核心应用程序,但重新启动后无法识别 dotnet 命令,并且我面临此错误 [dotnet: command not found]。

After I run these two lines of code on terminal the dotnet command can run correctly.在终端上运行这两行代码后,dotnet 命令可以正确运行。

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.您可以在重启后看到我通过 Putty 连接到树莓派的 SSH 连接的屏幕截图。

在此处输入图片说明

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. PATH是一个:分隔的每个目录的列表,其中文件应该可以通过在命令行中写入文件名来执行。 (You still need the x permission) (您仍然需要x权限)

dotnet is not in your PATH . dotnet不在您的PATH

The command export PATH=... changes the PATH for your current session.命令export PATH=...更改当前会话的PATH

If you want to have dotnet everytime on startup, create a symlink from /usr/bin/dotnet to $HOME/dotnet/dotnet :如果您希望每次启动时都使用 dotnet,请创建从/usr/bin/dotnet$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.或将复制命令添加到$HOME/.bashrc文件的底部。

[ NOTE ] [注意]

If you don't have dotnet installed on $HOME/dotnet/ , you will need to change that directory in the ln command如果您没有在$HOME/dotnet/上安装$HOME/dotnet/ ,则需要在ln命令中更改该目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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