Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fix: `Application.ExecutablePath` returns dll instead of exe (#2801) #2838
In .NET artifacts are DLLs even for executable projects. With some automagic they get bundled into executables.
Following the guidance from the Runtime team retrieve the path to the executable via
Microsoft Reviewers: Open in CodeFlow
@@ Coverage Diff @@ ## release/3.1 #2838 +/- ## ==================================================== + Coverage 24.85382% 24.8638% +0.00997% ==================================================== Files 844 844 Lines 260290 260274 -16 Branches 36896 36894 -2 ==================================================== + Hits 64692 64714 +22 + Misses 190874 190837 -37 + Partials 4724 4723 -1
In .NET artifacts are DLLs even for executable projects. With some automagic they get bundled into executables. However `Assembly.GetEntryAssembly()` always returns the dll instead of the exe. Following the guidance from the Runtime team retrieve the path to the executable via `GetModuleFileNameW` call. Resolves #1143 (cherry picked from commit 2af3af9)