“Value does not fall within the expected range” when opening RandomAccessStream
问题 I have been struggling with this problem for days. Why do I get " Value does not fall within the expected range " exception in this conversion method? (it's windows phone 8.1 app) public static async Task<string> ConvertToBase64(this BitmapImage bitmapImage) { RandomAccessStreamReference rasr = RandomAccessStreamReference.CreateFromUri(bitmapImage.UriSource); var streamWithContent = await rasr.OpenReadAsync(); //raises an exception byte[] buffer = new byte[streamWithContent.Size]; var result