Export (0) Print
Expand All

DeploymentDownloadException Class

Note: This class is new in the .NET Framework version 2.0.

Indicates that there was an error downloading either the ClickOnce manifests or the deployment's files to the client computer.

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

[SerializableAttribute] 
public class DeploymentDownloadException : DeploymentException
/** @attribute SerializableAttribute() */ 
public class DeploymentDownloadException extends DeploymentException
SerializableAttribute 
public class DeploymentDownloadException extends DeploymentException

A DeploymentDownloadException can indicate that a number of problems occurred when the user tried to download a ClickOnce application update:

  • The client's computer's network connection is down.

  • The Web server, FTP server, or file share hosting the update is unavailable.

  • One or more of the files in the ClickOnce deployment was not found.

To obtain detailed error information about an exception, consult the ClickOnce error log. For more information, see Troubleshooting ClickOnce Deployments.

The following code example installs an application update synchronously, and reports to the user if there was a problem downloading either the manifests or the deployment's files.

private void InstallUpdateSync()
{
    if (ApplicationDeployment.IsNetworkDeployed)
    {
        Boolean updateAvailable = false;
        ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;

        try
        {
            updateAvailable = ad.CheckForUpdate();
        }
        catch (DeploymentDownloadException dde)
        {
            // This exception occurs if a network error or disk error occurs
            // when downloading the deployment.
            MessageBox.Show("The application cannt check for the existence of a new version at this time. \n\nPlease check your network connection, or try again later. Error: " + dde);
            return;
        }
        catch (InvalidDeploymentException ide)
        {
            MessageBox.Show("The application cannot check for an update. The ClickOnce deployment is corrupt. Please redeploy the application and try again. Error: " + ide.Message);
            return;
        }
        catch (InvalidOperationException ioe)
        {
            MessageBox.Show("This application cannot check for an update. This most often happens if the application is already in the process of updating. Error: " + ioe.Message);
            return;
        }

        if (updateAvailable)
        {
            try
            {
                ad.Update();
                MessageBox.Show("The application has been upgraded, and will now restart.");
                Application.Restart();
            }
            catch (DeploymentDownloadException dde)
            {
                MessageBox.Show("Cannot install the latest version of the application. Either the deployment server is unavailable, or your network connection is down. \n\nPlease check your network connection, or try again later. Error: " + dde.Message);
            }
            catch (TrustNotGrantedException tnge)
            {
                MessageBox.Show("The application cannot be updated. The system did not grant the application the appropriate level of trust. Please contact your system administrator or help desk for further troubleshooting. Error: " + tnge.Message);
            }
        }
    }
}

System.Object
   System.Exception
     System.SystemException
       System.Deployment.Application.DeploymentException
        System.Deployment.Application.DeploymentDownloadException

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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

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

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft