This line is fine in a WinForm Framework3.5 but not in a WPF Framework3.5.
Path.GetDirectoryName(Application.ExecutablePath);
How can I get the exe path on a WPF app ?
This line is fine in a WinForm Framework3.5 but not in a WPF Framework3.5.
Path.GetDirectoryName(Application.ExecutablePath);
How can I get the exe path on a WPF app ?
There are several ways to get exe path. Try the next:
Try this:
System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );
You can unpack a Uri like this:
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);