我做了一个" dotnet发布-r linux-arm"为Raspberry PI构建名为TestSerialCommunication的.NET Core 2.0控制台应用程序。然后我将发布目录复制到Raspberry PI并运行代码。但是,代码需要访问串口,所以为了测试这个,我需要以root身份运行它。
我尝试了以下内容:
$ cd publish
$ TestSerialCommunication
-bash: TestSerialCommunication: command not found
$ ./TestSerialCommunication
-bash: ./TestSerialCommunication: Permission denied
1)为什么这两个命令的行为不同?我认为" ./"只是当前目录。
然后我尝试以root身份运行:
$ sudo ./TestSerialCommunication
sudo: ./TestSerialCommunication: command not found
2)如何以root身份正确运行TestSerialComunication程序?