title: C# DirectoryEntry object security property throwing a null reference exception
body: <p>I'm trying to trace an application error and I'm no whiz on the WinNT provider side. Here's the code I'm debugging:</p>
  
  <pre><code> public string GetCurrentRequesterIdentity()
      {
          var a = HttpContext.Current.User.Identity.Name.Split('\\');
  
          using (var adEntry = new DirectoryEntry("WinNT://" + a[0] + "/" + a[1]))
          {
              return adEntry.Properties["FullName"].Value.ToString();
          }
      }
  </code></pre>
  
  <p>When I debug this code and run "? New DirectoryEntry("WinNT://DOMAIN/User")" where DOMAIN and User are (supposedly) valid entries, the window returns the following for the ObjectSecurity line:</p>
  
  <p>ObjectSecurity: 'new DirectoryEntry("WinNT://[DOMAIN]/[USER]").ObjectSecurity' threw an exception of type 'System.NullReferenceException'</p>
  
  <p>I've seen the application throw an error of "The network path was not found." I have only been able to replicate this error once and not again. Unfortunately, it happens almost every time for 2 production users, but never happens in the test environment.</p>
  
  <p>Has anyone seen this situation before? Or know where to look to track it down?</p>