Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Windows Phone WMAppManifest reader that doesn't waste cycles reading the file every time you need to access a value. Usage: var version = ApplicationInfo.Version.
public static class ApplicationInfo
#region Private Members
const string AppManifestName = "WMAppManifest.xml";
const string AppNodeName = "App";
#region Properties
public static string Title { get; private set; }
public static string Version { get; private set; }
public static string Author { get; private set; }
public static string Description { get; private set; }
static ApplicationInfo()
var settings = new XmlReaderSettings { XmlResolver = new XmlXapResolver() };
using (var rdr = XmlReader.Create(AppManifestName, settings))
if (!rdr.IsStartElement())
throw new FormatException(AppManifestName + " is missing " + AppNodeName);
Title = rdr.GetAttribute("Title");
Version = rdr.GetAttribute("Version");
Author = rdr.GetAttribute("Author");
Description = rdr.GetAttribute("Description");
catch (Exception)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.