XPlat.ApplicationModel
XPlat.Core
XPlat.Device.Display
XPlat.Device.Geolocation
XPlat.Device.Launcher
XPlat.Device.Power
XPlat.Device.Profile
XPlat.Foundation
XPlat.Media.Capture
XPlat.Storage
XPlat.Storage.Pickers
XPlat.UI.Core

PackageVersion

Namespace: XPlat.ApplicationModel

Represents the package version info

public struct PackageVersion

Supported platforms

Platform

Version

.NET Standard

1.4

Xamarin.Android

8.1

Xamarin.iOS

1.0

UWP

10.0

Example

Use the Package.Current property to get the package for the current app. Use the Package.Id property to get the package ID, from which you can then get the version.

using XPlat.ApplicationModel;
Package package = Package.Current;
IPackageId packageId = package.Id;
PackageVersion version = packageId.Version;

Fields

Major

The major version number of the package.

public ushort Major;

Minor

The minor version number of the package.

public ushort Minor;

Build

The build version number of the package.

public ushort Build;

Revision

The revision version number of the package.

public ushort Revision;

Related information

References

PackageVersion - Microsoft Docs