title: Finding current directory during Visual Studio debugging session?
body: <p>How can I find the current directory for a .NET application
  running under the Visual Studio debugger?</p>
  
  <p><strong>Update 1</strong>. To be clear: I don't want to change the code
  or get information in the program itself - I just want to
  get information about the application currently being
  debugged.</p>
  
  <p>While debugging a .NET <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a> application (mixed VB.NET and
  C#) I was not sure from which location a XML file was being
  read from. I expected the current directory to be the
  application's directory. However, using Process Explorer, 
  properties for the process result in:</p>
  
  <blockquote>
    <p>D:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\</p>
  </blockquote>
  
  <p>(right click on process/Properties/tab Image/Current Directory).</p>
  
  <p>Hovering the cursor over the process in the main view of Process Explorer 
  revealed a different result (see below for a screenshot):</p>
  
  <blockquote>
    <p>D:\dproj\DTASCall\DTASuperCharge\bin\</p>
  </blockquote>
  
  <p>What is correct?</p>
  
  <p>Starting the application standalone displays the expected
  current directory,</p>
  
  <blockquote>
    <p>D:\dproj\DTASCall\DTASuperCharge\bin\</p>
  </blockquote>
  
  <p>in the Process Explorer process properties window.</p>
  
  <hr>
  
  <p>Annotated screen-shot of Process Explorer:</p>
  
  <p><a href="http://www.pil.sdu.dk/1/until2039-12-31/PEdiscrepancy_2009-09-02.png" rel="noreferrer">Alt text http://www.pil.sdu.dk/1/until2039-12-31/PEdiscrepancy_2009-09-02.png</a></p>