title: How to catch "Unhandled win32 exception occured in AppName [procId]."
body: <p><em>using c#, Visual studio 2013, Windows Store App</em></p>
  
  <p><strong>A little bit long explanation</strong></p>
  
  <p>Create some simple Windows Store App that works with JSON stored data. After increasing of data amount I start to get a message <code>Unhandled win32 exception occured in AppName [procId].</code> - please see pic below:</p>
  
  <p><img src="https://i.stack.imgur.com/XhHEA.png" alt="enter image description here"></p>
  
  <p>I try to reduce amount of stored data in JSON file, but after some time off work during debugging I got this message again. So situation - if I have a lot of data - I can do few operations (few means 5) in app and got this exception, if I have minimum amount of data I can work with app a little bit more (mean 12-17 different operation). Operation means - read from file, save, load pages etc.</p>
  
  <p>I <em>googling</em> a little bit and found few possible causes:</p>
  
  <ul>
  <li><p><strong>I must to setup DEP at PC, following next steps:</strong></p>
  
  <ol>
  <li>Right click on “My Computer”. Then select “Properties”.</li>
  <li>Select “Advanced” Tab.</li>
  <li>Select “Settings” for “Performance”.</li>
  <li>Select “Data Execution Prevention” Tab.</li>
  <li>Select option “Turn on DEP for essential Windows programs and services only.” If this option is already selected, click on “OK”, then again click on “OK”.</li>
  <li>Restart your computer.</li>
  </ol></li>
  </ul>
  
  <p><em>Try - not helps</em></p>
  
  <ul>
  <li><strong>Check and enabling just in time debugging in my VISUAL STUDIO</strong> </li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/s9oEz.png" alt="enter image description here"></p>
  
  <p><em>Try - not helps</em></p>
  
  <ul>
  <li><strong>Check what type of exception can be catches by VS - choose all:</strong></li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/bwGJ4.png" alt="enter image description here"></p>
  
  <p><em>Try - not helps</em></p>
  
  <ul>
  <li><strong>Read <a href="http://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx" rel="noreferrer">this post at MSDN</a></strong> </li>
  </ul>
  
  <p>Found next: </p>
  
  <blockquote>
    <p>An unhandled win32 exception occurred in . Just-In-Time debugging this exception failed with the following error: The logged in user did not have access to debug the crashing application.
    This message indicates that Just-In-Time debugging failed because you do not have proper access permissions.</p>
  </blockquote>
  
  <p>So, mean <strong>you do not have proper access permissions</strong>.</p>
  
  <p>Try to launch with Administrator rights my App:</p>
  
  <p><img src="https://i.stack.imgur.com/h7U71.png" alt="enter image description here"></p>
  
  <p><em>Try - not helps</em></p>
  
  <ul>
  <li><strong>Also read a lot posts from <a href="https://stackoverflow.com/search?q=unhandled%20win32%20exception">here</a>.</strong> </li>
  </ul>
  
  <p>Found <a href="https://stackoverflow.com/a/3192714/2012219">this</a> and so <a href="http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx" rel="noreferrer">this MSDN</a> post useful. Try to add some code to my app:</p>
  
  <pre><code>    public MainPage()
      {
          this.InitializeComponent();
          this.navigationHelper = new NavigationHelper(this);
          this.navigationHelper.LoadState += navigationHelper_LoadState;
          this.navigationHelper.SaveState += navigationHelper_SaveState;
          TimeBinding();
          Application.Current.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
      }
  
      static void MyHandler(object sender, UnhandledExceptionEventArgs args)
      {
          string e = args.Message.ToString();
      }
  </code></pre>
  
  <p>but nothing catched...</p>
  
  <p><em>So, try - not helps</em></p>
  
  <p><strong>Questions:</strong> </p>
  
  <ol>
  <li>Why I got this message and what possible reasons that I not describe can be root cause for exception like <code>"Unhandled win32 exception occured in AppName [procId]."</code>?</li>
  <li>Am I right understand usage of <code>UnhandledException</code>? Maybe I'm wrong with it and so I can't catch required exception (I'm just studying for .NET)?</li>
  </ol>