如何以root身份运行.Net Core 2.0应用程序?

时间:2017-12-11 22:10:30

标签: .net-core

我做了一个" 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程序?

0 个答案:

没有答案