Hi Friends how can i find the location of execute of my application in WPF (C# or vb.net) ? i used this code on windows forms . Application.ExecutablePath.ToString()); But IN WPF i had this message from Visual studio that : system.window.application does not contain definition for ExecutablePath. tnx for ur attentions :)
views:
61answers:
3
+2
A:
System.Reflection.Assembly.GetExecutingAssembly().Location
should work.
Blorgbeard
2010-06-26 12:34:21
thank u!worked
shaahin
2010-06-26 12:44:53
+2
A:
Several alternatives:
Directory.GetParent(Assembly.GetExecutingAssembly().Location)
System.AppDomain.CurrentDomain.BaseDirectory
Only in VB:
My.Application.Info.DirectoryPath
Konrad Rudolph
2010-06-26 12:37:09
A:
In C#
Application.ExecutablePath
Should work. It gives you the path of your executable file. Be aware though: if you debug your application, then the path it returns would be project/bin/debug/ .
Igor
2010-06-26 13:16:02