title: Winform Application can't startup due to System.Security.SecurityException
body: <p>My Windows Form Application NOT starting due to System.Security.SecurityException.
  Here is code on Program.cs </p>
  
  <pre><code> [STAThread]
      static void Main()
      {
  
          Application.EnableVisualStyles();
          Application.SetCompatibleTextRenderingDefault(false);
          Application.Run(new BaseForm());
      }
  </code></pre>
  
  <p>Stacktrace as below.</p>
  
  <pre><code>StackTrace:
         System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp; stackMark, Boolean isPermSet)
         System.Security.CodeAccessPermission.Demand()
         System.Windows.Forms.Application.add_ThreadException(ThreadExceptionEventHandler value)
         MyApp._0.Program.Main()
  </code></pre>
  
  <p>I have no idea to solving this... Any hints are appreciated.</p>