title: Visual Studio 2010, remote debugging and AD not co-operating, what's wrong?
body: <p>I'm remote debugging a console app which has some AD functionality. </p>
  
  <p>When I run it on the remote server it works like a charm. (I mean I log in with RDC and literally double click the console app .exe file.) </p>
  
  <p>While remote debugging however, I'm getting an error in the AD related code - "Could not find the domain or the domain does not exist". </p>
  
  <p>Important to note is my dev machine is not on the same domain as remote server. I'm also remote debugging over VPN. </p>
  
  <p>I also want to mention that otherwise the remote debugging seems to be working ok, breakpoints are being met, symbols loading, values populating. </p>
  
  <p>The full source code is kinda long, so I'll just provide an illustation of what is causing the problem:</p>
  
  <pre><code>System.DirectoryServices.DirectoryEntry dirEntry; // in reality this is setup via an ad helper class
  dirEntry.rootOU.Children.Find(strOU, "Something"); // BOOM! here is where it can't find the domain
  </code></pre>
  
  <p>Its not a code issue, and the domain does genuinely exist and is reachable, when code is natively executed on the server, issue only comes in with remote debugging. </p>
  
  <p>Thanks in advance for suggestions on a fix / cause.</p>