Windows Phone 7 – one fix for “Xap packaging failed. Object reference not set to an instance of an object.”

I faced that error while building a WP7 app after doing some reorganization of files within the solution.

VS2010 didn’t give any pointers, so i turned to Google and found this post in Jayway Team’s blog. My problem was not exactly the same, but that post pointed me to the right direction. Thank you to Jayway Team!

I had accidentally moved the default “ApplicationIcon.png” and “BackGround.png” from the root of the solution to a resources folder. After a bit of digging around the solution, i found the references to those images in the WMAppManifest.xml-file located within properties folder.

Issue went away by altering the paths. Really simple, but why-oh-why VS couldn’t give me any useful information right at the beginning…


10 Responses to “Windows Phone 7 – one fix for “Xap packaging failed. Object reference not set to an instance of an object.””

  1. Thanks pal, this was doing my head in.

  2. thanks this was the problem for me also, after installing Mango Tools beta 2

  3. Thanks a lot, your post saved me hours of time and headache.

  4. Loren Erickson Says:

    thanks for the post. this helped me solve a similar problem.

  5. Zelleriation Says:

    Thanks! Yo saved to hours of work! :) :)

  6. Green Banana Says:

    You save my life. Thank you very much

  7. Thanks. Turned out I had renamed my icon file accidentally.

  8. I’ll jump on the bandwagon. I’d renamed some files in my source control and created some new background images for my live tile and there were still some files “included in the project” that were no longer there. I was ready to spend the day restoring previous versions and recreating all the changes I’d made in the last 24 hours, but 5 minutes after reading your post, I was back in good working order!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: