ApplicationDeployment.CheckForUpdateAsync Method ()

 

Checks UpdateLocation asynchronously to determine whether a new update is available.

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

member CheckForUpdateAsync : unit -> unit

Exception Condition
InvalidOperationException

ClickOnce throws this exception immediately if you call the CheckForUpdateAsync method while an update is already in progress.

DeploymentDownloadException

The deployment manifest cannot be downloaded. This exception appears in the Error property of the CheckForUpdateCompleted event.

InvalidDeploymentException

The deployment manifest is corrupted. You will likely need to redeploy the application to fix this problem. This exception appears in the Error property of the CheckForUpdateCompleted event.

CheckForUpdateAsync returns immediately and starts a separate thread for downloading the updated application. When the method completes or is canceled, it raises the CheckForUpdateCompleted event. You can use AsyncCompletedEventArgs in this event handler to determine whether the operation was canceled, or if an exception was raised during update.

You can cancel an asynchronous update by calling CheckForUpdateAsyncCancel.

System_CAPS_noteNote

 If CheckForUpdate discovers that an update is available, and the user chooses not to install it, ClickOnce will prompt the user that an update is available the next time the application is run. There is no way to disable this prompting. (If the application is a required update, ClickOnce will install it without prompting.)

The following example checks for an update asynchronously, and installs the update if one exists.

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

PermissionSet

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

.NET Framework
Available since 2.0
Return to top
Show: