C# Executable Executing directory
<p>What is the best method of getting the path the C# executable is running from?</p>

<p>I need to use it for temp folders etc and currently I'm using:</p>

<pre><code>Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)
</code></pre>

<p>But I then need to do a:</p>

<pre><code>.Replace("file:\\", string.Empty)
</code></pre>

<p>as this gives me a URI type path (i.e. has file:\ at the start) which is unusable with some other parts of my code.</p>
