ApplicationDeployment.UpdateAsync Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Starts an asynchronous download and installation of the latest version of this application.

Namespace:   System.Deployment.Application
Assembly:  System.Deployment (in System.Deployment.dll)

member UpdateAsync : unit -> unit

Exception Condition

The local computer did not grant this application the permission level it requested to execute.


Your ClickOnce deployment is corrupted. For tips on how to diagnose and correct the problem, see Troubleshooting ClickOnce Deployments.


The new deployment could not be downloaded from its location on the network.

An application is considered updated when you publish a new version of the application to the location specified by UpdateLocation, and the version number in the application's deployment manifest is greater than the version number of the application currently installed on the user's computer.

While downloading the update, ClickOnce will raise the UpdateProgressChanged event handler on the main application thread to inform you of the status of the download. When the asynchronous update finishes or encounters an exception, ClickOnce will raise the UpdateCompleted event on the main application thread. Examine the AsyncCompletedEventArgs supplied to this event to determine whether the update succeeded.

If UpdateAsync throws an exception, ClickOnce calls UpdateCompleted and sets the Error property of AsyncCompletedEventArgs to the exception that was thrown.

UpdateAsync will download all files in a deployment not marked as "optional" in the application manifest. You can download optional files on demand by using the DownloadFileGroup or the DownloadFileGroupAsync method.

ClickOnce may already be updating the application automatically when you call the UpdateAsync method; if that happens, calls to this method will throw an InvalidOperationException.

If you have updated one or more files in your deployment, but you have not refreshed your application manifest, you will receive an InvalidDeploymentException. Most of the time, rebuilding your application manifest solves this problem. You will also receive this exception if a public-key signature on a deployment manifest or application manifest is invalid or missing.

An update may request a higher level of trust on the local computer than the previous version of the application. If the application uses Trusted Application Deployment, the common language runtime (CLR) trust manager examines the deployment manifest to determine whether it contains a valid trust license. If the deployment manifest does not contain a valid trust license, ClickOnce stops the installation and throws a TrustNotGrantedException. UpdateAsync will never display a prompt asking the user if they want to grant the application permission to run.

The following code example determines whether a new update is available at application load time; if a required update is available, it installs the update asynchronously. The example requires that you deploy a Windows Forms application that includes a StatusStrip control, and that this control contain a ToolStripStatusLabel control named downloadStatus.

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


For full access to the local computer. Associated enumeration: PermissionState.

.NET Framework
Available since 2.0
Return to top