-api-id | -api-type |
---|---|
P:Windows.ApplicationModel.Package.Dependencies |
winrt property |
Gets the packages on which the current package depends.
The packages on which the current package depends.
Important
Although the Package class is supported in an unpackaged process (that is, a process belonging to an app that lacks package identity), the Package.Current property is supported only in a packaged process (that is, a process belonging to an app that has package identity). To access a package's dependencies from an unpackaged process, use GetPackageInfo. And for more info about packaging, see Package a desktop or UWP app in Visual Studio.
// Get the app package
Package currentPackage = Package.Current;
// Get a list of dependencies for the app package. This includes all resource packages, framework packages, and optional packages.
IReadOnlyList<Package> dependencies = currentPackage.Dependencies;