다음을 통해 공유


ApplicationIcon must be in root directory

Just a minor itch I ran into today which I felt needed to scratch. I wanted to collect all my image resources into one place in a Windows Phone 7 app (a folder called, for the sake of argument, “images”). I knew that SplashScreenImage.jpg could not be moved but I went ahead and moved everything else and made the relevant changed to WMAppManifest.xml.

 <IconPath
  IsRelative="true"
  IsResource="false">images/ApplicationIcon.png</IconPath>
 <BackgroundImageURI 
  IsRelative="true" 
  IsResource="false">images/Background.png</BackgroundImageURI>

This works just fine for BackgroundImageURI but not for IconPath. The project will build but when you try to deploy you’ll get the error “Icon file images/ApplicationIcon.png not found. Make sure that the file is present in the application.”

It seems you can change the name of the application icon, but not its location. I believe it’s possible to make this work by manually copying files into the xap but that defeats the purpose of what I was trying to do so I’ll just have to stick with it in the root I suppose.