Getting Application Version Windows Phone 8

前端 未结 2 552
暗喜
暗喜 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 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?.

提交回复
热议问题