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();
}
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With