Reputation: 484
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
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