简体   繁体   中英

WP8 Get current App Version

I'm currently trying to get my app current version value via code. On MSDN is shown to use the property Id of the class Windows.ApplicationModel.Package:

http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.package.id.aspx

Unfortunately it seems that the property "Id" is not implemented in WP (it throws a "not implemented exception")

Is this API really supported on WP8 or maybe WP8.1? It works only for "store apps" (released)? Anyone have used it already?

I know I can parse the WMAppManifest.xml to get a value, but I need to accomplish this from an external assembly (a custom .dll), not the app assembly.

thanks F

You'll be able to get the version like this:

string Version = XDocument.Load("WMAppManifest.xml")
                .Root.Element("App").Attribute("Version").Value;

A better reference would be this:

Getting Application Version Windows Phone 8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM