title: Windows Phone 8.1 App Crashes When Not Debugging Async Await
body: <p>I am working on a Windows Phone 8.1 application. I am about a month into the project and have seen little to no issues with what I have written so far. </p>
  
  <p>I decided to do some testing on the application without running it through the VS 2013 debugger. Now, for some reason, the app crashes before it gets to the first screen. I get no exceptions or messages whatsoever(I am using Raygun for error logging).</p>
  
  <p>I am using async methods throughout(some async void, others async Task), but all of this works when debugging.</p>
  
  <p>The main thing that would help, is to get some sort of error message. I've been reduced to commenting out sections of code, but ultimately this is getting me nowhere because it seems when I think I've found the issue, I get another crash further down into the code.</p>
  
  <p>At one point, I found an issue with calling: ListView.UpdateLayout(). I commented this out and the app would run properly no crashes. I then un-commented some code further down and now it's crashing again.</p>
  
  <p>If anyone knows of a way to get exceptions from the phone or if someone has experienced this issue before, any help would be greatly appreciated. I can provide any further information that is needed.</p>
  
  <p><strong>UPDATE:</strong>
  I think I have narrowed the issue down to Sqlite.NET. I am using Sqlite.Net for WinRT along with an extension called SqliteNetExtensions. The particular statement is </p>
  
  <pre><code>    DataContext.Context.Connection.Table&lt;Message&gt;().Where(m =&gt; m.ChannelID == channelID &amp;&amp; m.ChannelID.Contains("C")).ToList();
  </code></pre>
  
  <p>If I comment this out, the app runs with no problems. This LINQ statement at most returns 100 records. I would not think that a 100 record SELECT statement could cause the app to crash, but it seems like the culprit. Any ideas on how to optimize Sqlite.NET?</p>
  
  <p><strong>UPDATE 2:</strong>
  Finally figured it out! It was not SQLite at all. It was not my code at all. It was my phone. I am running a Nokia Lumia Icon. I had installed Rudy Huyn's Lockscreen Beta a few weeks back. It caused some issues when I uninstalled it but it wasn't related to my application. Today, I had my business partner install my app on his phone, he has the same model phone. The app was about 50x faster and did not crash. I restored my phone from factory and, lo and behold, it ran perfectly. So, pro tip: DO NOT INSTALL LOCKSCREEN BETA BY RUDY HUYN!!!</p>