EDIT:
As of .NET 6, the recommended approach (CA1839) is to use System.Environment.ProcessPath
Original answer:
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
EDIT:
As of .NET 6, the recommended approach (CA1839) is to use System.Environment.ProcessPath
Original answer:
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName