Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WP7 app version

A Windows Phone 7 app, it seems, has two places with version number - one in AssemblyInfo.cs (via AssemblyVersion/AssemblyFileVersion attributes), the other is WMAppManifest.xml. Those two seem uncorrelated - changing one does not affect the other. The Marketplace, it seems, uses the one from the manifest - can someone please confirm this?

The real question is - how do I retrieve the one from manifest programmatically to display on the About screen?

like image 313
Seva Alekseyev Avatar asked Apr 15 '11 17:04

Seva Alekseyev


1 Answers

The WmAppManifest.xml number is in use. First two digits are relevant for Marketplace (it is checked when you do the update) next two are for your internal usage.

This is a regular XML file, open it as a XDocument and parse it. An example.

EDIT: the example is extraneous. For just the version, use:

string Version = XDocument.Load("WMAppManifest.xml")
    .Root.Element("App").Attribute("Version").Value;
like image 191
Lukasz Madon Avatar answered Oct 02 '22 05:10

Lukasz Madon