title: Windows Phone 8.1 app crashes when downloaded from store
body: <p>I'm dealing with a strange issue that's been giving me headaches for a long time.</p>
  
  <p>I've got a Windows Phone 8.1 (WinRT) app, whose first version I published a couple of years ago. Over the last few months, I've been working on a major update which includes augmented reality as the most prominent feature.</p>
  
  <p>Obviously, the app needs to make use of the camera preview, and that's where trouble starts. I've read discussions in other threads about problems with the camera API, but I didn't find a definite solution.</p>
  
  <p>Before submitting the update, I performed extensive tests on my Lumia 620 and all worked fine. But if the app is downloaded from the store, it crashes and the camera picture goes green as soon as the camera preview starts. It is the very same app package and all required capabilites have been declared.</p>
  
  <p>So basically I can't tell if my app works or not, unless I submit it to the store.</p>
  
  <p>Any help will be appreciated.</p>
  
  <p><strong>Edit</strong>: After several hidden-app submissions, I've narrowed down the cause of the crash to the following block of code:</p>
  
  <pre><code>RandomAccessStreamReference rasr = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Square44x44Logo.scale-100.png"));
  var streamWithContent = await rasr.OpenReadAsync();
  </code></pre>
  
  <p>The last of the above lines causes the app to terminate. The same code works fine when the app is deployed from VS.
  Any ideas?</p>