in Silverlight

Tip: “Object reference not set to an instance of an object” Error in Silverlight for Windows Phone 7

Problem :  “Object reference not set to an instance of an object.”  messagebox will be displayed when you are running Silverlight Windows Phone 7 Application in Visual Studio 2010.

Solution : Shawn Oster, Program Manager of Silverlight for Window Phone team, confirmed that this is a known issue that they are currently working on fixing for next update. The workaround for this issue is that you need to ensure that the solution is not highlighted in Solution Explorer.

Let’s take a look at the picture below. Solution “WP7ApplicationBar” is highlighted in Solution Explorer, right? That’s why you are getting this error.

In order to fix this, you need to move the selection by clicking on Project Name or other files in Solution Explorer. As you can see, Solution “WP7ApplicationBar” is highlighted in previous screenshot. And we moved the highlight to ProjectName in second screenshot. Then, you can try to run the application from Visual Studio again. I think it will work this time.

Hope you find it useful. I’m facing this problem quite so often lately. This funny trick helped me to solve this problem. :) If this trick doesn’t help you then please feel free to let me know.

Leave a Reply

  1. Damn, was almost giving it up. All my example applications wouldn’t run and giving me the same stupid error.

    Tnx for the tip, will test it on my home machine later today!

    DTK

  2. Yes. As the error message is not meaning enough, I didn’t know how to solve it as well. glad to hear that that solution solves your problem as well.

  3. Hi,
    Can you please help me on the step by step solution for this error because it is coming again in my project while opening as a new project.

    Thanks & Regards,
    - Amol

  4. Hi All,

    I found one solution to this problem may it will work for some one

    1] Install SDK from below link which also include Visual Studio 2010 Express for Windows Phone and do not install Visual studio separetly.

    http://www.microsoft.com/visualstudio/en-us/products/2010-editions/windows-phone-developer-tools

    2] If it still ask some error for .NET Framework Version 1.1.14322 then install below link ,

    http://www.microsoft.com/download/en/confirmation.aspx?id=17851

    Thanks & Reagrds,
    - Amol

  5. Hi….i have problem that Object reference not set to an instance of an object while creating silver light application.
    It not even create the project, plz help me.