title: C# with Visual Studio: Published App Cannot Run After Installation
body: <p>I wrote a simple reminder app for desktop in C#, and I can publish and install it with no problem. However, when I try to run the app, the icon shows up in the system tray for a brief second and then disappears, and then app doesn't open or show up anywhere. I checked the event viewer and it says that there are errors for "Application error" and ".NET Runtime" </p>
  
  <p>It can run perfectly if I run it from Visual Studio. The issue only occurs when I try to install the app and then run it. I haven't tested on other computers yet.</p>
  
  <p>I've checked my target framework in the Application tab of Visual Studio, and it says .NET Framework 4.5.2. I've made sure it matches when setting up the prerequisite, but it doesn't solve the issue.</p>
  
  <p>"Application Error" Details:</p>
  
  <pre><code>Faulting application name: Reminder.exe, version: 1.0.0.0, time stamp: 0x5d47ba36
  Faulting module name: KERNELBASE.dll, version: 10.0.17134.885, time stamp: 0x59816e73
  Exception code: 0xe0434352
  Fault offset: 0x00112cf2
  Faulting process id: 0x1b10
  Faulting application start time: 0x01d54b590d580089
  Faulting application path: C:\Users\charl\AppData\Local\Apps\2.0\5TG7Y9JQ.2CR\0BOH7HGZ.WVN\remi..tion_71aa56c27f5d79b6_0001.0000_31f9cf6345a508a8\Reminder.exe
  Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
  Report Id: d1a4e88f-6eb2-4655-a7fe-bbff68de9c4c
  Faulting package full name: 
  Faulting package-relative application ID: 
  </code></pre>
  
  <p>".NET Runtime" Details:</p>
  
  <pre><code>Application: Reminder.exe
  Framework Version: v4.0.30319
  Description: The process was terminated due to an unhandled exception.
  Exception Info: System.IO.FileNotFoundException
     at Reminder_desktop_application.FileStreamer.GetData()
     at Reminder_desktop_application.TaskControler.LoadTasks()
     at Reminder_desktop_application.Reminder..ctor()
     at Reminder_desktop_application.Program.Main()
  </code></pre>
  
  <p>The error appears to be from:
  Get Data:</p>
  
  <pre><code>    public string[] GetData()
      {
          try
          {
              data = System.IO.File.ReadAllLines(FILE_NAME);
              return data;
          }
          catch (FileNotFoundException e)
          {
              throw new FileNotFoundException(e.ToString());
          }
      }
  </code></pre>
  
  <p>and LoadTasks:</p>
  
  <pre><code>    public void LoadTasks()
      {
          string[] lines = dataStreamer.GetData();
          string[] words;
          foreach(string line in lines)
          {
              words = line.Split(',').ToArray&lt;string&gt;();
              this.Add(new Task(words[2], Convert.ToDateTime(words[0]), TimeSpan.Parse(words[1]), Convert.ToBoolean(words[3])));
          }
      }
  </code></pre>