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 );
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With