Latitude attitude

Dell Latitude 7280 is a business laptop with tons of consumer attitude

4K all the way

You probably don't NEED a 4K webcam, but we love Logitech's BRIO 4K anyway

Long live Windows phone

Contrary to popular belief, Windows phone won't die anytime soon

XP-YESSSSSSS

Dell's already awesome XPS 15 gets even better in 2017

Surface Pwn 5

Surface Pro 5, Project NEON details leaked on LinkedIn?

Redefining the PC

Why Microsoft's Surface phone could be MUCH more than a mere 'phone'

Surface table meets Windows 10

Yes, we did put Windows 10 on the original Surface table ... and it rocks

Cream o' the crop

Before buying a Microsoft laptop, check out our pick for the absolute best

Simple and secure, just the way I like it

We think Windows 10 Cloud is a great idea, here's why

uber micro

Halo Wars 2 has something for everyone. Here's our full review.

Oldie but goldie

We reviewed Microsoft's decade-old Surface table

Creators Update comin' at ya

These are the coolest new features in the next big Xbox One update (video)

Buyer's guide

The Razer Blade 14 is the best laptop Razer has to offer

Windows 10 app gems

10 terrific Windows 10 apps you should be using

Tower of power

Here's what we think of Dell's XPS Tower Special Edition

Quite a deal

Grab the complete C# coding bootcamp for $41!

Your go-to laptop guide

Introducing our ultimate laptop buyer's guide

Listen here

Attn Android and iPhone users: What you need to know about Windows phone

Old is new?

The original Surface Pro still holds its own in the 2-in-1 world

Xbox Greenlight?

No, internet, Microsoft isn't opening Xbox to all UWP games

< >
Welcome to the Windows Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 6 of 6
  1. Dileep 1's Avatar
    Member

    Posts
    8 Posts
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
       #1  
    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?
  2. elyl's Avatar
    Member

    Posts
    25 Posts
    Global Posts
    31 Global Posts
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #2  
    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!
  3. Dileep 1's Avatar
    Member

    Posts
    8 Posts
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
       #3  
    Than Q for the reply. I tried using the above approach and getting the same issue.
  4. elyl's Avatar
    Member

    Posts
    25 Posts
    Global Posts
    31 Global Posts
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #4  
    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.
  5. Christian Amado's Avatar
    Member

    Posts
    1 Posts
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #5  
    Quote Originally Posted by Dileep 1 View Post
    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.
  6. jumanakassim's Avatar
    Member

    Posts
    1 Posts
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #6  
    Remove the '/' before the image url

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

Posting Permissions

";