title: Environment.CurrentDirectory vs System.Reflection
body: <p>Out of the following methods to get the working directory of an executing assembly, is there a recommendation on which one is considered Best Practice?  I hear from my developers that Method 1 fails on Windows 7 SP1 64-bit <em>sometimes</em>, unless run with elevated permissions (<strong>Run as Administrator</strong>).  But Method 2 works all the time.  Is there a reason that the former would fail sometimes?</p>
  
  <p>Method 1:<br></p>
  
  <pre><code>System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location())
  </code></pre>
  
  <p>Method 2:<br></p>
  
  <pre><code>Environment.CurrentDirectory
  </code></pre>