Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Application Version Windows Phone 8

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 in C#

 string buildVersion = Package.Current.Id.Version.Build.ToString();

but it gives me the following error:

'Windows.ApplicationModel.Package.Current.Id' threw an exception of type 'System.NotImplementedException'

anyone know how I can get the app version number?

like image 555
Ardavan Kalhori Avatar asked Mar 22 '13 19:03

Ardavan Kalhori


People also ask

Is Windows Phone 8 still supported?

Your Windows Phone 8.1 device should continue to work after July 11, 2017, but there will be no updates after July 11, 2017 (including security updates) and device backup functionality and other backend services will be phased out as described above.

Can I update my Windows Phone 8.1 to 10?

The Windows Phone 8.1 to Windows 10 Mobile upgrade uses an "opt-in" or "seeker" model. An eligible device must "opt-in" to be offered the upgrade. For consumers, the Windows 10 Mobile Upgrade Advisor app is available from the Windows Store to perform the opt-in.

How can I update my Windows Phone 8.1 to 10 offline?

Download the updater tool from this link- https://www.microsoft.com/en-us/download/details.aspx?id=56726 and install it on your PC. Connect the phone to the PC using a USB cable, run the tool and follow the instructions. If my reply is helpful, please mark it so.


1 Answers

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?.

like image 155
Paul Annetts Avatar answered Oct 17 '22 05:10

Paul Annetts