title: Loading Images in some directories via BitmapImage results in E_NETWORK_ERROR
body: <p>I am new to Windows 8 development and Microsoft's technologies. I've done a lot of iOS development, but I've never touched Visual Studio, C#, etc before, so I am learning a lot (frameworks, IDEs, language) all at once. Forgive me if this is something simple, but I can't find an answer anywhere.</p>
  
  <p>Note: I'm using Visual Studio Express 2013, C#, and Windows 8.1</p>
  
  <p>For learning purposes I'm just trying to create an app that loads images, displays them on the screen, and allows the user to rotate, move, resize, and arrange them. I've got this working, except for one major bug that I can't figure out: When I load images from some directories everything works fine, when I load images from other directories I get E_NETWORK_ERROR and BitmapImage.ImageFailed. I can see no reason for this. I can actually take an image and put it in a directory and it will load, copy the same image to another directory, and it wont load.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>private async void addImageButton_Click(object sender, RoutedEventArgs e)
  {
      Windows.Storage.Pickers.FileOpenPicker filePicker = new Windows.Storage.Pickers.FileOpenPicker();
      filePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
      filePicker.FileTypeFilter.Add(".jpg");
      filePicker.FileTypeFilter.Add(".png");
      filePicker.FileTypeFilter.Add(".bmp");
      filePicker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
      Windows.Storage.StorageFile imageFile = await filePicker.PickSingleFileAsync();
  
      if (imageFile != null)
      {
          System.Diagnostics.Debug.WriteLine(imageFile.Path);
          Windows.UI.Xaml.Media.Imaging.BitmapImage bitmap = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(imageFile.Path));
          System.Diagnostics.Debug.WriteLine(bitmap.UriSource);
          bitmap.CreateOptions = Windows.UI.Xaml.Media.Imaging.BitmapCreateOptions.None;
          Image img = new Image();
          img.Source = bitmap;
          this.theCanvas.Children.Add(img);
      }
  }
  </code></pre>
  
  <p>This seems to work great with image files from some directories, and doesn't work at all with others. For example: in my Pictures library I have a "Camera Roll" directory that the Windows 8 camera app saves to, and I also have my Steam screenshots directory. If I try to open images in my Steam screenshots directory it works fine; however, if I try to load images in the Camera Roll directory it fails with E_NETWORK_ERROR. If I copy images from the Camera Roll directory to the Steam Screenshots directory I can open them.</p>
  
  <p>Can anyone point out what's wrong? I'm starting to think this isn't a code problem so much as a security / capabilities / declarations type thing. Is there something I need to declare or request to get unfettered access to the filesystem? Do I need to form my URI differently or something?</p>
  
  <p>EDIT: Here is some output from the debug statements showing the paths and URIs:</p>
  
  <p>Loaded fine:</p>
  
  <pre><code>C:\Program Files (x86)\Steam\userdata\24321739\760\remote\72850\screenshots\2013-12-04_00001.jpg
  file:///C:/Program Files (x86)/Steam/userdata/24321739/760/remote/72850/screenshots/2013-12-04_00001.jpg
  </code></pre>
  
  <p>Resulted in E_NETWORK_ERROR</p>
  
  <pre><code>C:\Users\Adam\Pictures\Camera Roll\WIN_20131023_194718.JPG
  file:///C:/Users/Adam/Pictures/Camera Roll/WIN_20131023_194718.JPG
  </code></pre>