How to Get the Windows Phone App version from WMAppManifest file ?

This blog post will explain how to get the Windows Phone App version from the WMAppManifest file using C# in Windows Phone 8.

The WMAppManifest file contains the configurations items related to the Windows Phone app. It includes the following tabs
– Application UI
– Capabilities
– Requirements
– Packaging

The Packaging tab contains the Version Number of the App.

image

How to Get the Windows Phone App version from WMAppManifest file ?

The WMAppManifest file is just an XML file and hence we can use the XDocument class to retreive this element from the file.

Below is a sample code snippet which retreives the App version number from WMAppManifest.xml using XDocument.

private void Button_Click_1(object sender, RoutedEventArgs e)
{
  string appVersionNumber = XDocument.Load("WMAppManifest.xml")
         .Root.Element("App").Attribute("Version").Value;
  MessageBox.Show(appVersionNumber);
}

image

    1 Comment

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you will learn about sync provider notifications in Windows 11 and how to disable or enable it...
In this tutorial, let’s learn how to enable or disable the startup sound in Windows 11. By default, when Windows...
The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application . This will be useful when the...