Assembly.GetExecutingAssembly()

BradA points out the use of Assembly.GetExecutingAssembly().Location to find out the path to the executable. One thing to watch out for is that Assembly.GetExecutingAssembly() can return null under some conditions. Off the top of my head, this very likely will happen if you're not running in the default appdomain, or your process was not started by a managed exe....

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>