Jesse
Jesse

Reputation: 484

Cannot Find ApplicationDeployment in System.Deployment

I have a built program and I am trying to change out the default clickOnce update checker with a hard programmed one. I have added the using System.Deployment; but it does not contain the assembly information I need to call. What am I missing here? I have searched MSDN but it keeps saying this is the correct namespace to call.

The error shows as: The name ApplicationDeployment does not exist in the current context

Code from Program:

        private void UpdateApplication()
    {
        if (ApplicationDeployment.IsNetworkDeployed)
        {
            ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
            ad.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(ad_CheckForUpdateCompleted);
            ad.CheckForUpdateProgressChanged += new DeploymentProgressChangedEventHandler(ad_CheckForUpdateProgressChanged);

            ad.CheckForUpdateAsync();
        }
    }

Upvotes: 8

Views: 11180

Answers (2)

Fede
Fede

Reputation: 44068

You need to add using System.Deployment.Application; as well.

Upvotes: 2

Ravi Y
Ravi Y

Reputation: 4376

ApplicationDeployment class is present in System.Deployment.Application namespace and not System.Deployment. Change your using accordingly or try with the full name System.Deployment.Application.ApplicationDeployment

Upvotes: 18

Related Questions