title: File access denied in deployment
body: <p>I've created a simple Logging class below in C# for my single threaded application. It has 3 self explanatory public methods (Clear(), Log(), and Show()). It works as expected when I'm running the program in development mode. When I deploy and install the program however, I get the following error the first time Log() is called. </p>
  
  <pre><code>System.UnauthorizedAccessException: 
  Access to the path 'C:\Program Files (x86)\programDir\log.txt' is denied.
  </code></pre>
  
  <p>Is there anything I'm missing? I'm not sure how to debug since it works fine in development mode.</p>
  
  <pre><code>public static class Logger
  {
  
      private static string FilePath
      {
          get
          {
              return Path.Combine(Directory.GetCurrentDirectory(), "log.txt");
          }
      }
  
      public static void Clear()
      {
          if (File.Exists(FilePath))
          {
              File.Delete(FilePath);
          }
      }
  
      public static void Log(string sLine)
      {
          File.AppendAllLines(FilePath, new string[] { sLine });
      }
  
      public static void Show()
      {
          if (File.Exists(FilePath))
          {
              Process.Start(FilePath);
          }
      }
  
  }
  </code></pre>