This documentation is archived and is not being maintained.

ApplicationDeployment.UpdateCompleted Event

Occurs when ClickOnce has finished upgrading the application as the result of a call to UpdateAsync.

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

JScript does not support events.

The UpdateCompleted event is called on the main application thread. You may call your application's Windows Forms controls directly within this callback without triggering an exception.

Check the Error property of the AsyncCompletedEventArgs supplied to this callback. If this property is a null reference (Nothing in Visual Basic), the installation was successful; if it is not a null reference (Nothing in Visual Basic), the installation did not succeed, and you can find more information about this installation failure through the Error property. Once the update has been downloaded, you will need to call the Restart method on the Application to use the newer version of the application.

If the installation of the update was canceled by a call to UpdateAsyncCancel, the Cancelled property of the AsyncCompletedEventArgs class will be true.

To use this event handler, your application must import both the System.Deployment.Application and System.ComponentModel namespaces.

The following code example determines at application load time whether a new update is available; 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.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: