title: C# - Application terminates unexpectedly without leaving traces
body: <p>I have a simple C# application/game using SFML.Net that currently stops running / terminates within 1 or 2 seconds after being executed without any warning, exception, etc. whatsoever. Consider the following code:</p>
  
  <pre><code>public static void Main(string[] args)
  {
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
  
     --&gt; The following two lines are run
     Console.WriteLine("Hello");
     Console.WriteLine("Please don't go...");
  
     // Run the game
     try
     {
        --&gt; This line is reached
        Game.Run();
     }
     catch (Exception e)
     {
        --&gt; This line is never reached
        Console.WriteLine(e.Message.ToString());
     }
  
     --&gt; These lines are never reached
     Console.WriteLine("Noone ever comes here, I feel so lonely... :(");
     Console.ReadKey();
     }
  }
  </code></pre>
  
  <p>At this point you probably expect that something is wrong with the Game.Run() method. The odd thing is that the first line of the <strong>method is never reached</strong> according to the VS Debugger.</p>
  
  <pre><code>public static void Run()
  {
      try
      {
          --&gt; Never reached
          LoadContent();
  
          // Do stuff here
  
          while (window.IsOpen())
          {
              // The classic game loop
          }
      }
      catch (Exception e)
      {
          --&gt; Never reached
          Console.WriteLine(e.Message.ToString());
          Console.ReadKey();
      }
  }
  </code></pre>