title: System.IO.FileNotFoundException occurs after call to DirectoryEntry()
body: <p>I am debugging a small C# app that I just wrote. The app seems to run fine on my development box but throws the following errors when run on other machines (all machines are windows 7 pro x64 w/ .net 4 installed):</p>
  
  <pre><code>    Application: WolApp.exe
  Framework Version: v4.0.30319
  Description: The process was terminated due to an unhandled exception.
  Exception Info: System.IO.FileNotFoundException
  Stack:
     at WolApp.PowerModel..ctor()
     at WolApp.PowerController..ctor()
     at WolApp.Program.Main()
  </code></pre>
  
  <p>A second error succeeds this one from kernelbase.dll, but, one thing at a time....</p>
  
  <p>From the stack trace it seems that the unhandled exception is being throwin inside of the PowerModel constructor, which consists only of this:</p>
  
  <pre><code>public PowerModel() {
  entry = new DirectoryEntry();
  }
  </code></pre>
  
  <p>Where entry is a field of the PowerModel class. I have since added the following try catch block</p>
  
  <pre><code> public PowerModel() {
              try
              {
                  entry = new DirectoryEntry();
              }
              catch (System.IO.FileNotFoundException e)
              {
                  string sSource;
                  string sLog;
                  string sEvent;
  
                  sSource = "WolApp";
                  sLog = "Application";
                  sEvent = e.Message;
                  EventLog.CreateEventSource(sSource,sLog);
                  EventLog.WriteEntry(sSource, sEvent);
               }
          }
  </code></pre>
  
  <p>Yet the same exception is still thrown (and only on external machines)?</p>
  
  <p>Also, an additional message appears in the log from Windows Error Reporting, as follows:</p>
  
  <pre><code> 1745074215 
     5 
     CLR20r3 
     Not available 
     0 
     wolapp.exe 
     1.0.0.0 
     4d657be0 
     WolApp 
     1.0.0.0 
     4d657be0 
     3 
     26 
     System.IO.FileNotFoundException 
  
     C:\Users\username\AppData\Local\Temp\WERC3EF.tmp.WERInternalMetadata.xml 
     C:\Users\username\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_wolapp.exe_62bdee217c82fa90fcdaeb137c1659c897785b85_20036868 
  
     0 
     ce7dc05c-3f93-11e0-8907-0024e82e58f8 
     0 
  </code></pre>