PackageVersion PackageVersion PackageVersion PackageVersion PackageVersion Struct


Represents the package version info.

public : struct PackageVersion
struct winrt::Windows::ApplicationModel::PackageVersion
public struct PackageVersion
Public Structure PackageVersion
var packageVersion = {

   build: /* Your value */,

   major: /* Your value */,

   minor: /* Your value */,

   revision: /* Your value */

Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


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

var package = Windows.ApplicationModel.Package.current;
var packageId =;
var version = packageId.version;

using Windows.ApplicationModel;

Package package = Package.Current;
PackageId packageId = package.Id;
PackageVersion version = packageId.Version;
Dim package As Windows.ApplicationModel.Package = Windows.ApplicationModel.Package.Current
Dim packageId As Windows.ApplicationModel.PackageId = package.Id
Dim version As Windows.ApplicationModel.PackageVersion = packageId.Version
Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current;
Windows::ApplicationModel::PackageId^ packageId = package->Id;
Windows::ApplicationModel::PackageVersion version = packageId->Version;


Build Build Build Build Build

The build version number of the package.

ushort Build;
ushort Build;
ushort Build;
Build As ushort;
var ushort =; = ushort;

Major Major Major Major Major

The major version number of the package.

ushort Major;
ushort Major;
ushort Major;
Major As ushort;
var ushort = packageVersion.major;
packageVersion.major = ushort;

Minor Minor Minor Minor Minor

The minor version number of the package.

ushort Minor;
ushort Minor;
ushort Minor;
Minor As ushort;
var ushort = packageVersion.minor;
packageVersion.minor = ushort;

Revision Revision Revision Revision Revision

The revision version number of the package.

ushort Revision;
ushort Revision;
ushort Revision;
Revision As ushort;
var ushort = packageVersion.revision;
packageVersion.revision = ushort;

See Also