How can I find the location of my application\'s executable in WPF (C# or VB.Net)?
I\'ve used this code with windows forms:
Application.ExecutablePat
This is what I use. It works even in debugger.
using System.IO; using System.Diagnostics; public static string GetMyBinDirectory() { return Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); }
It uses some powerfull classes, like Process and ProcessModule