我们在 C# 中有一个 winforms clickonce 应用程序,它被授予完全信任并使用有效证书签名。
该应用程序在 Windows XP、Windows 7 上运行良好并正确更新。但是,在 Windows 8 机器上,它只是无法更新。该应用程序运行正常。但是,第一个升级到更高版本的更新请求失败,并显示:System.Deployment.Application.TrustNotGrantedException
调用失败后代码ApplicationDeployment::CheckForDetailedUpdate()
失败。想知道为什么会发生这种情况,因为完全相同的代码在所有以前的 Windows 版本上运行良好。任何帮助将不胜感激。以下是相关的堆栈跟踪:
System.Deployment.Application.TrustNotGrantedException: User has refused to grant required permissions to the application.
at System.Deployment.Application.ApplicationTrust.RequestTrust(SubscriptionState subState, Boolean isShellVisible, Boolean isUpdate, ActivationContext actCtx, TrustManagerContext tmc)
at System.Deployment.Application.DeploymentManager.DetermineTrustCore(Boolean blocking, TrustParams tp)
at System.Deployment.Application.DeploymentManager.DetermineTrust(TrustParams trustParams)
at System.Deployment.Application.ApplicationDeployment.CheckForDetailedUpdate(Boolean persistUpdateCheckResult)
at System.Deployment.Application.ApplicationDeployment.CheckForDetailedUpdate()