title: Windows Phone 8.1 Exception when creating WriteableBiitmap
body: <p>I'm making a Windows Phone 8.1 app (Windows Runtime, not Silverlight 8.1), and I need to create a WriteableBitmap from a Stream, but when I try to do so, I get this exception: "An exception of type 'System.Exception' occurred in mscorlib.ni.dll but was not handled in user code</p>
  
  <blockquote>
    <p>Additional information: The component cannot be found. (Exception from
    HRESULT: 0x88982F50)"</p>
  </blockquote>
  
  <p>I have tried a lot of things, but still no luck. My code is as follows:</p>
  
  <pre><code>private async void Button_Click(object sender, RoutedEventArgs e)
  {
      var files = await KnownFolders.CameraRoll.GetFilesAsync();
      for(int i=0; i&lt;files.Count; i++)
      {
          var fileStream = await files[i].OpenReadAsync();
          if(fileStream != null)
          {
               WriteableBitmap writeableBmp = await BitmapFactory.New(1, 1).FromStream(fileStream);
          }
      }
  }
  </code></pre>
  
  <p>But this doesn't happen if I replace</p>
  
  <pre><code>var fileStream = await files[i].OpenReadAsync();
  </code></pre>
  
  <p>with, for example, </p>
  
  <pre><code>var fileStream = await files[0].OpenReadAsync();
  </code></pre>
  
  <p>Any ideas?
  Thank you.</p>