1. Dileep 1's Avatar
    Hi

    I am getting Null Reference Exception when StreamResourceInfo attempts to get a ResourceStream in Windows phone 8 emulator. When i tried the same in Windows phone 7 emulator, the stream is getting correctly. But its not working on Windows phone 8 emulator. Please find the below code.

    StreamResourceInfo streamInfo = App.GetResourceStream(new Uri("/Image;component/Images/123.png", UriKind.Relative));

    Please help me out if any?
    11-20-2012 01:54 AM
  2. elyl's Avatar
    I'm not a WP developer (yet), but I am a .NET developer...
    I always try to avoid referring to resources by their URI, as you never know exactly what it's going to be called, nor does it tell you in a debugger if the URI doesn't exist.
    I don't know if this will work in WP, but in .NET I'd normally use:
    [CODE]System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("123.png")[/CODE]
    to get the actual stream.

    Hope you figure it out!
    11-20-2012 08:19 AM
  3. Dileep 1's Avatar
    Than Q for the reply. I tried using the above approach and getting the same issue.
    11-20-2012 09:13 AM
  4. elyl's Avatar
    Is your png file set as Resource or Embedded Resource? Perhaps it's not being added to the build if one of these options isn't set.
    11-20-2012 10:24 AM
  5. Christian Amado's Avatar
    Hi

    I am getting Null Reference Exception when StreamResourceInfo attempts to get a ResourceStream in Windows phone 8 emulator. When i tried the same in Windows phone 7 emulator, the stream is getting correctly. But its not working on Windows phone 8 emulator. Please find the below code.

    StreamResourceInfo streamInfo = App.GetResourceStream(new Uri("/Image;component/Images/123.png", UriKind.Relative));

    Please help me out if any?
    Have you set your png image as Resource on your properties? Have you got the Images folder in your root?

    Regards.
    11-20-2012 05:24 PM
  6. jumanakassim's Avatar
    Remove the '/' before the image url
    12-25-2012 02:31 AM

Similar Threads

  1. When do you expect to get your Nokia?
    By jwckauman in forum Nokia Lumia 920
    Replies: 13
    Last Post: 11-09-2012, 12:59 PM
  2. Replies: 8
    Last Post: 08-31-2011, 07:35 AM
  3. Replies: 1
    Last Post: 07-27-2011, 08:29 AM
  4. Busy Signal when attempting to call
    By jesdt in forum Samsung Omnia 7
    Replies: 0
    Last Post: 07-19-2011, 07:00 PM
LINK TO POST COPIED TO CLIPBOARD