Getting Application Version Windows Phone 8

前端 未结 2 549
暗喜
暗喜 2020-12-11 04:09

I\'m following the sample code on MSDN (http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.package.id.aspx) to get the current application version

相关标签:
2条回答
  • 2020-12-11 04:56

    for windows phone 8 ..this works..

    String version= XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Val‌​ue; 
    
    0 讨论(0)
  • 2020-12-11 05:01

    That API isn't available: if you look closely at MSDN you'll see that this throws an exception for WP8. You'll have to use the same techniques as for WP7.x.

    Namely:

    1. Look up the version number in the manifest.
    2. Look up the version of an assembly.
    3. Wire up a build number of your own.

    See https://stackoverflow.com/a/5680679/694641, WP7 - get compile/build date from code?.

    0 讨论(0)
提交回复
热议问题