× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

What is the path to my external executable that I've included?

Codementor User
Feb 05, 2015
<p>The root directory of your application can be obtained by...</p> <pre><code>string appRoot = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); </code></pre> <p>This statement requires System.IO and System.Diagnostics in order to compile.</p> <p>You can append to this value to reach a subdirectory, for example "data", in your application root by...</p> <pre><code>string dataPath = Path.Combine(appRoot, "data"); </code></pre> <p>The application needs to be running in full trust for these to work...</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/8859817/What%20is%20the%20path%20to%20my%20external%20executable%20that%20I've%20included?/8859913">Stack Overflow</a>.</p>
comments powered by Disqus