Find the location of my application's executable in WPF (C# or vb.net)? Find the location of my application's executable in WPF (C# or vb.net)? wpf wpf

Find the location of my application's executable in WPF (C# or vb.net)?


System.Reflection.Assembly.GetExecutingAssembly().Location should work.


Several alternatives:

Directory.GetParent(Assembly.GetExecutingAssembly().Location)System.AppDomain.CurrentDomain.BaseDirectory

Only in VB:

My.Application.Info.DirectoryPath


this is useful for you:Application.ExecutablePath equals to:

Process.GetCurrentProcess().MainModule.FileName;