title: Running a Linux executable via Process.Start gives: Exec format error
body: <p>I have a small C#/.NET6.0 commandline application that should run a certain linux command via <code>System.Diagnostics.Process</code>.</p>
  <pre><code>var processStartInfo = new ProcessStartInfo
  {
      FileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @&quot;Compressonator/compressonatorcli_linux_x86_64_4.2.5150/compressonatorcli&quot;),
      ArgumentList = { &quot;-fd&quot;, compression, &quot;-noprogress&quot;, fileName, outputFilename },
      RedirectStandardOutput = true,
      RedirectStandardError = true,
      UseShellExecute = false
  };
  
  var process = Process.Start(processStartInfo);
  Console.WriteLine(process.StandardOutput.ReadToEnd());
  Console.WriteLine(process.StandardError.ReadToEnd());
  process.WaitForExit();
  </code></pre>
  <p>However this fails with the following exception on an Ubuntu 64bit running in a VirtualMachine:</p>
  <pre><code>System.ComponentModel.Win32Exception (8): An error occurred trying to start process '/media/sf_imageconverter/net6.0/Compressonator/compressonatorcli_linux_x86_64_4.2.5150/compressonatorcli' with working directory '/media/sf_imageconverter/net6.0'. Exec format error 
     at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32&amp; stdinFd, Int32&amp; stdoutFd, Int32&amp; stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
     at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
     at System.Diagnostics.Process.Start()
     at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
  </code></pre>
  <p>The strange thing is, that when running the process directly from a terminal on the same machine it works fine:</p>
  <pre><code>$/media/sf_imageconverter/net6.0/Compressonator/compressonatorcli_linux_x86_64_4.2.5150/compressonatorcli
  </code></pre>
  <p>The process is <a href="https://github.com/GPUOpen-Tools/compressonator/releases/tag/V4.2.5185" rel="nofollow noreferrer">https://github.com/GPUOpen-Tools/compressonator/releases/tag/V4.2.5185</a></p>
  <p>My .NET6.0 app is set to compile to <code>AnyCPU</code> but I have also tried the other options without success.</p>