Friday, September 21, 2012

Xap packaging failed. Object reference not set to an instance of an object

Xap packaging failed. Object reference not set to an instance of an object

I'm getting this error message on my PC when I try to build my Windows Phone app:

Xap packaging failed. Object reference not set to an instance of an object 

I'm using Dropbox. On my laptop, It works perfectly fine and I can debug etc...On my PC however, I can't.

I tried many things such as:

  • Delete obj/Debug Folder
  • Check for files which are missing on the Solution Explorer

So far, nothing has helped.

Any idea how I can fix this?

Answers & Comments...

Answer: 1

Try the following:

  • Have Visual Studio closed
  • Download all your files to your computer
  • Delete Bin and obj folders completely.
  • Open the .sln
  • Rebuild

If if fails expand the References in te Solution explorer and make sure all your dll's are found. If a dll have a yellow exclamation point that means its not found. I'm thinking that one of your references are set to an absolute path on your laptop and that's missing on your PC.

by : MyKuLLSKIhttp://stackoverflow.com/users/1139769

Answer: 2

The problem lies in your startup object in your Application. I have met this error to many times.

It usually happens when I change the name of my class/namespace Application class. Or it might even be conflicting with your dropbox locations.

To Fix this.

  1. Right click your main project or Alt+Enter
  2. Go to the silverlight tab and set your startup object
by : Rikkoshttp://stackoverflow.com/users/1032725

Answer: 3

This can happen if a file is removed from the disk itself, but not from the Solution through Visual Studio. Delete the file through Visual Studio (it should be marked with a little yellow hazard icon) and Rebuild.

Credit to Andreas Hammar via http://blog.jayway.com/2011/06/03/wp7-build-error-xap-packaging-failed/ - his solution worked for me.

by : Ryan Shripathttp://stackoverflow.com/users/1943

Answer: 4

You should check, in every folder of your project, for missing files or wrong references.

You can get this problem just with a single missing image, if its Build Action property is set to Content or similar...

enter image description here

Check your files and then Rebuild your project!

by : MAXEhttp://stackoverflow.com/users/833644




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog