The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
PackageId class
Provides package identification info, such as name, version, and publisher.
Syntax
var packageId = Windows.ApplicationModel.Package.current.id;
Attributes
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The PackageId class has these types of members:
Methods
The PackageId class inherits methods from the Object class (C#/VB/C++).
Properties
The PackageId class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the processor architecture for which the package was created. | |
| Read-only | Windows Phone only. Gets the value of the Author attribute for the specified application package. | |
| Read-only | Gets the family name of the package. | |
| Read-only | Gets the full name of the package. | |
| Read-only | Gets the name of the package. | |
| Read-only | Windows Phone only. Gets the value of the ProductID attribute associated with this application package. | |
| Read-only | Gets the publisher of the package. | |
| Read-only | Gets the publisher ID of the package. | |
| Read-only | Gets the resource ID of the package. | |
| Read-only | Gets the package version info. |
Examples
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. This example gets package identity information by using members of the Package and PackageId classes.
var package = Windows.ApplicationModel.Package.current; var packageId = package.id; var version = packageId.version; var output = [ "Name: \"" + packageId.name + "\"", "Version: " + version.major + "." + version.minor + "." + version.build + "." + version.revision, "Architecture: " + packageId.architecture, "ResourceId: \"" + packageId.resourceId + "\"", "Publisher: \"" + packageId.publisher + "\"", "PublisherId: \"" + packageId.publisherId + "\"", "FullName: \"" + packageId.fullName + "\"", "FamilyName: \"" + packageId.familyName + "\"", "IsFramework: " + package.isFramework ];
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- Samples
- App package information sample
- Concepts
- App packages and deployment
- Reference
- Package.Current
- Package.Id
Build date: 2/25/2013
