Tuesday, June 18, 2013

Making modifying WMAppManifest.xml easier

When it comes to some of the more advanced features of Windows Phone 8 development you may need to make changes to the manifest file (WMAppManifest.xml) which the SDK doesn't provide a nice visual way to do.
In this scenario it means opening the xml file in a text editor and, probably, copying and pasting the required pieces for the appropriate page on MSDN-after you've searched for and found it.

Obviously this isn't an ideal way of working and recently I felt something needed to be done.

After exploring a few possibilities, I've created nine new NuGet packages which will allow you to modify the WMAppManifest.xml file to indicate supporting:

  • New tile formats, via reflection, when a 7.X app is run on a 7.8 or 8.0 device.
  • Background location tracking
  • Fast-App-Resume
  • Lock Screen background images
  • Lock Screen notification text
  • Lock Screen notification counts
  • All Lock Screen items (rather than adding them individually)
  • Lauching via a custom schema
  • Custom file formats/extensions

You can find the packages by searching for "WMAppManifest"
Or, if like me, you're super lazy (efficient), you can search for "WMAM" (the acronym) and you'll find them that way too.

The package will make appropriate modifications to the WMAppManifesst.xml file and add a readme file to the project.
When you uninstall the package the readme file is removed but the modifications to the XML file remain.
This is deliberate. The NuGet package is just a means to an end. There is no expectation that you'll need to update the package in the future so you can uninstall it immediately after it's been installed. This will mean you have no unnecessary dependencies in your project.

If you are adding support for file extensions or a custom schema you'll still need to modify the file manually to set the schema name and file extension. Everything else is set up though. You just need to alter the "ChangeMe" or "SetMe" values. This is documented in the readme file for each package so you may want to read that before removing the readme file and/or uninstalling the package.

You can find all the packages at nuget.org if you want to explore them in a bit more detail.

If you think these could be useful, you use them, find an issue or have any other feedback I'd love to hear it. Please do share your thoughts and experiences with this. It's my attempt to help make Windows Phone development that little bit easier for everyone.


Post a comment