我有一个内置程序,我正在尝试用硬编程的程序更改默认的 clickOnce 更新检查器。我已经添加了,using System.Deployment;
但它不包含我需要调用的程序集信息。我在这里想念什么?我搜索了 MSDN,但它一直说这是要调用的正确命名空间。
错误显示为:
The name ApplicationDeployment does not exist in the current context
程序代码:
private void UpdateApplication()
{
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
ad.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(ad_CheckForUpdateCompleted);
ad.CheckForUpdateProgressChanged += new DeploymentProgressChangedEventHandler(ad_CheckForUpdateProgressChanged);
ad.CheckForUpdateAsync();
}
}