简体   繁体   中英

How to get app version in Windows Universal App?

Does anyone know how to get the application version in a Windows Universal app?

There used to be a way reading the xap xaml information in Windows Phone Silverlight apps, but as this changed I can't seem to find a new way of doing this.

You can read version from Package.Id . There you will find: Major , Minor , Build and Revision numbers of your app:

string appVersion = string.Format("Version: {0}.{1}.{2}.{3}",                          
                    Package.Current.Id.Version.Major, 
                    Package.Current.Id.Version.Minor, 
                    Package.Current.Id.Version.Build,
                    Package.Current.Id.Version.Revision);

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