title: C# under Linux, WorkingDirectory not working properly
body: <p>I have an issues with <code>WorkingDirectory</code>, and it is not setting the desired path correctly. I wrote a simple hello world test program, <code>a.out</code>, to try out <code>WorkingDirectory</code>. And the directory hierarchy is such:</p>
  
  <pre><code>/home/cli2/test
     /bin/Debug/netcoreapp2.1/subdir/
        a.out
     /obj
     Program.cs
     test.csproj
  </code></pre>
  
  <p>I have the following settings for the Process class</p>
  
  <pre><code>process.StartInfo.FileName = "a.out"
  process.StartInfo.UseShellExecute = false;
  process.StartInfo.WorkingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "/subdir/";
  </code></pre>
  
  <p>When I execute <code>dotnet run</code>, I would get an error of:</p>
  
  <pre><code>Unhandled Exception: System.ComponentModel.Win32Exception: No such file or directory
  </code></pre>
  
  <p>The issue that confuses me is that if I move <code>a.out</code> to the top directory such that: </p>
  
  <pre><code>/home/cli2/project
     /bin/Debug/netcoreapp2.1/subdir/
     /obj
     Program.cs
     test.csproj
     a.out  
  </code></pre>
  
  <p>While having the same <code>StartInfo</code> settings, <code>process.start()</code> executes the hello world program without error. Furthermore, if I change <code>FileName = "ls"</code> with the original subdirectory hierarchy, it does print out <code>a.out</code>. For that case the <code>WorkingDirectory</code> is behaving as expected. So I do understand this discrepancy and why I cannot call <code>a.out</code> in a different directory. </p>
  
  <p>Also I have tried both absolute and relative path for <code>WorkingDirectory</code>, neither works when I call <code>a.out</code>.</p>