In addition to the good answer by Mika: when you got the instance of an assembly, use the property
Assembly.Location
; it will give you the file name of the main executable of the give assembly:
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.location.aspx[
^].
I would also note that this is a good method free from problems other method have; for example
Application.ExecutablePath
is only good for Forms applications; some other methods depends on how the application is hosted and give wrong or useless results for Windows Services or in case of application hosted by the IDE.
—SA