title: My application crashes with a FileNotFoundException, and I don't understand why
body: <p>I have a text editor I made, which has been working perfectly for the past month without any problems. But today, and all of yesterday, every time I open a txt file from explorer (double clicking it) instead of it opening in my editor, a message appears saying:</p>
  
  <blockquote>
    <p>Text Editor has encountered a problem and needs to close. We are sorry
    for this inconvenience. [Send error report] or [Don't send].</p>
  </blockquote>
  
  <p>When I click on "What does this error report contain", it shows the following:</p>
  
  <pre><code>EventType : clr20r3     P1 : texteditor.exe     P2 : 1.0.0.0     P3 : 4ad32c52     
  P4 : mscorlib     P5 : 2.0.0.0     P6 : 492b834a     P7 : 343f     P8 : d8     
  P9 : system.io.filenotfoundexception
  </code></pre>
  
  <p>So that basically tells me that its looking for a file that doesn't exist. But here's my problem:<br>
  The file I am trying to open DOES exist because I just double clicked on it </p>
  
  <p>Here is the code that opens a file that has been double clicked on from windows explorer:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Windows.Forms;
  
  namespace TextEditor
  {
      static class Program
      {
          /// &lt;summary&gt;
          /// The main entry point for the application.
          /// &lt;/summary&gt;
          [STAThread]
          static void Main(string[] args)
          {
              Application.EnableVisualStyles();
              Application.SetCompatibleTextRenderingDefault(false);
  
              if (args.Length &gt;= 1)
              {
                  Form1 f = new Form1();
                  f.txt.Text = System.IO.File.ReadAllText(args[0]);
                  f.txt.Tag = args[0];
  
                  Application.Run(f);
              }
              else Application.Run(new Form1());
          }
      }
  }
  </code></pre>