PackageManager.AddPackageAsync method

Applies to Windows only

Adds a package (main package) and its dependencies for the current logged-in user.


Public Function AddPackageAsync(
  packageUri As Uri,  
  dependencyPackageUris As IEnumerable(Of Uri),  
  deploymentOptions As DeploymentOptions 
) As IAsyncOperationWithProgress(Of DeploymentResult, DeploymentProgress)



Type: System.Uri [.NET] | Windows::Foundation::Uri [C++]

The source URI of the main package. The URI must follow file URI scheme (file://) since the only supported URI schemes are local file paths and local network paths.


Type: IIterable<Uri> [C++] | System.Collections.Generic.IEnumerable<Uri> [.NET]

The source URIs of the dependency packages. If there are no dependency packages or if the dependency packages are already registered, this parameter can be null.


Type: DeploymentOptions

One of the permitted enumeration values from the deployment options. ForceApplicationShutdown and None are the only valid options for this method and specifying any other option will result in an E_INVALIDARG return value.

Return value

Type: IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress>

The status of the deployment request. The DeploymentResult contains the final returned value of the deployment operation, once it is completed. The DeploymentProgress can be used to obtain the percentage of completion over the entire course of the deployment operation.


The following example uses the PackageManager.AddPackageAsync method to install a package that has no dependencies or whose dependencies are already installed. Note that the path of the main package is passed as an argument in the example. AddPackageAsync returns an object that can be used to manage the asynchronous operation. The example uses the Completed property to set the delegate and checks the Status property to determine the status of the deployment operation. If the status is Error, the example calls the GetResults method to get additional error information.

No code example is currently available or this language may not be supported.


Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported


Windows::Management::Deployment [C++]



See also

Add app package sample



© 2015 Microsoft