Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Find ApplicationDeployment in System.Deployment

Tags:

c#

wpf

clickonce

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();
        }
    }
like image 551
Jesse Avatar asked Jan 23 '13 17:01

Jesse


1 Answers

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

like image 117
Ravi Y Avatar answered Nov 16 '22 03:11

Ravi Y