Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
program: fix computation of app path with single file
When publishing GCM as a 'single file' application, the computed path to the entry executable is no longer correct. On .NET Core 3.1, using Assembly.Location resolves to the temporary extracted DLL file path. On .NET 5 Assembly.Location always returns the empty string. Since .NET 5, published single-file apps no longer use the self- extraction model, and are real single file with all assemblies and native libraries statically linked/bundled. We now use the Environment.GetCommandLineArgs() method to get the raw underlying "argv" arguments, which argv[0] is the absolute file path to the entry executable.
- Loading branch information