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.