I like to keep things organized, especially code. So when I finished the icon/tile design for my WP7 app I decided to place them in the Resources folder of my solution instead of the default (root project folder). I marked the images as Content and set them to always copy to output.
After a rebuild they appeared on the dropdown of the Application tab in the project properties window. See “TileBackground”.
I thought wow, this is going to be easy, I won’t even have to edit xml! I was wrong. What followed was hours of confusion and irritation.
When I tried to debug with the emulator to verify the icon and tile were updated I received the following error:
The application could not be launched for debugging. Ensure that the target device screen is unlocked and that the application is installed.
At first I thought my environment had been hosed so I restarted VS and the emulator, no change. Then I rebooted, no change. So I had to assume this error must be due to the icon/tile change I had made. I checked the WMAppManifest and only the image name was set. So I thought I must have to set the folder name, if the image is in a subfolder.
This fixed the tile background.
Next I tried to set the icon path in the same way but when I attempted to debug there was a new error:
Icon file Resources ApplicationIcon.png not found. Make sure that the file is present in the application.
Long story short, I wasn’t able to find a way to reference the icon image in a subfolder, I guess its not supported. In the end I decided its not worth the hassle and put them back in root. I suggest you save yourself the frustration and do the same.
If anyone has had a difference experience please leave a comment.