title: How to get actual path to executable when using .netcore 3.0 and using the /p:PublishSingleFile=true flag?
body: <p>I recently upgraded an application to dotnet core 3 and started using the PublishSingleFile flag during the build process. With these two changes the way the executable path is found has changed. Now instead of getting the path where the executable file is, I get redirected to a random directory in <code>/var/tmp/.net/</code> where as I used to get <code>/opt/appdir/</code>.</p>
  
  <pre><code>Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
  </code></pre>
  
  <p>Edit: So it seems like the random dir it is spitting out actually points to an unpacked version of my application which does not contain vital resources that are in the other directory.</p>