title: C# Directory.CreateDirectory stop working
body: <p>I have a C# application, it works properly on many pc, laptop. But, I copied to my customer's pc (4TB HDD - windows 10 Home Edition), my application stop working!</p>
  
  <p>I try to put <code>MessageBox.Show()</code> in some line to find where is broken. And it stop at <code>Directory.CreateDirectory(@"D:\\mypath")</code></p>
  
  <p>The PC have <code>D:</code> and I don't know why it broken.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>string now = DateTime.Now.ToString("HH_mm_ss");
  string strDuongDan;
  
  strDuongDan = @"D:\VideoLuuTru\" + DateTime.Now.Month.ToString() + "_" + DateTime.Now.Year.ToString();
  
  if (!Directory.Exists(strDuongDan))
      Directory.CreateDirectory(strDuongDan);
  
  string strDuongDan2 = strDuongDan + "\\" + DateTime.Now.ToString("dd"); ;
  
  if (!Directory.Exists(strDuongDan2))
      Directory.CreateDirectory(strDuongDan2);
  </code></pre>
  
  <p>How can I trace exactly my errors, and is there anything wrong from my code? It running perfectly in many PCs but with this PC, it broken.</p>
  
  <p>Is my problem related to large hard drive space?</p>
  
  <p>My customer's IT staff installed my app on his laptop (Windows 10 Home) and installed the same windows to this pc. My app run on His laptop without errors</p>
  
  <p>Thanks you!</p>
  
  <p><strong>EDIT:</strong>
  My Function and my errors:</p>
  
  <p><strong>Function:</strong></p>
  
  <pre><code> public void makevideo()
          {
              string now = DateTime.Now.ToString("HH_mm_ss");
              string strDuongDan;
  
              strDuongDan = @"D:\VideoLuuTru\" + DateTime.Now.Month.ToString() + "_" + DateTime.Now.Year.ToString();
  
              if (!Directory.Exists(strDuongDan))
                  Directory.CreateDirectory(strDuongDan);
  
              string strDuongDan2 = strDuongDan + "\\" + DateTime.Now.ToString("dd"); ;
              if (!Directory.Exists(strDuongDan2))
                  Directory.CreateDirectory(strDuongDan2);
          }
  </code></pre>
  
  <p><strong>Call function</strong></p>
  
  <pre><code> ThreadStart childref = new ThreadStart(() =&gt; makevideo());
  
   Thread childThread = new Thread(childref);
  
   try { childThread.Start(); }
   catch (Exception ex)
   {
       MessageBox.Show(ex.ToString());
    }
  </code></pre>
  
  <p><strong>Errors:</strong>
  **</p>
  
  <pre><code>Application: camera.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. 
  Exception Info: System.IO.FileNotFoundException at camera.Form1.makevideo() at camera.Form1.&lt;Form1_Load&gt;b__6_0() at         System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
  System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, 
  System.Threading.ContextCallback, System.Object) at 
  System.Threading.ThreadHelper.ThreadStart()
  </code></pre>
  
  <p>** </p>