title: Could not load file or assembly or one of its depencencies. The system cannot find the file specified
body: <p>I am working to program (that was written by other people), this program is written in C#, using Visual Studio 2010. Almost everything was fine (except some logical problems) until i tried to rum my program in Release mode instead of Debug mode. This program downloads testing modules (PingTest.dll) and runs in when computer is Idle. Debug version stores all files in running folder while Release version "installs" into c:\Users\Macke\AppData\Local\NetMon\ and re-runs from there (all files needed to run are also storred there). So when i run NetMon.exe it crashes. I've added some try/catch and found an error:  </p>
  
  <p>Could not load file or assembly 'CountDow_Idle, version=1.0.0.2, Culture=neutral, PublicKeyToken=null' or one of its depencencies. The system cannot find the file specified.</p>
  
  <p>The part of the code that causes it: 
      AppDomain aDom = AppDomain.CreateDomain("TestingDomain");
                  Assembly testAsm = null;</p>
  
  <pre><code>            using (FileStream fs = File.Open(TMP_MOD_NAME, FileMode.Open))
              {
                  using (MemoryStream ms = new MemoryStream())
                  {
                      byte[] buffer = new byte[1024];
                      int read = 0;
                      while ((read = fs.Read(buffer, 0, 1024)) &gt; 0)
                          ms.Write(buffer, 0, read);
  
                      testAsm = aDom.Load(ms.ToArray());
                  }
              }
  
              INetMonTest iTest = null;
              foreach (Type type in testAsm.GetExportedTypes())
              {
                  if (type.BaseType.FullName == "CountDown_Idle.INetMonTest")
                  {
                      try
                      {
                          iTest = (INetMonTest)aDom.CreateInstanceAndUnwrap(AssemblyName.GetAssemblyName(TMP_MOD_NAME).FullName, type.FullName);
                      }
                      catch (Exception ex)
                      {
                          MessageBox.Show("AppDomain creation failed:\n\n" + ex.Message);
                      }
                      break;
                  }
              } 
  </code></pre>
  
  <p>I've allready looked for correct versions (in AssemblyInfo.cs file)</p>
  
  <p>So maby anyone could help me. 
  Thanx in advance</p>