title: How to run .Net Core 2.0 app as root?
body: <p>I have done a "dotnet publish -r linux-arm" to build a .NET Core 2.0 console application named TestSerialCommunication for a Raspberry PI. Then I copied the publish directory over to the Raspberry PI and the code runs. But, the code needs access to a serial port so in order to test this I need to run it as root.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>$ cd publish
  $ TestSerialCommunication
  -bash: TestSerialCommunication: command not found
  $ ./TestSerialCommunication
  -bash: ./TestSerialCommunication: Permission denied
  </code></pre>
  
  <p>1) Why does these two commands behave differently? I thought that "./" was only the current directory.</p>
  
  <p>Then I tried to run as a root:</p>
  
  <pre><code>$ sudo ./TestSerialCommunication
  sudo: ./TestSerialCommunication: command not found
  </code></pre>
  
  <p>2) How do I correctly run the TestSerialComunication program as root?</p>