简体   繁体   English

手动更新已签名的ClickOnce应用程序会抛出TrustNotGrantedException

[英]Manual update for signed ClickOnce app throws TrustNotGrantedException

I have a ClickOnce deployment which is signed by a certificate obtained from Symantec. 我有一个ClickOnce部署,该部署由从Symantec获得的证书签名。 The security warning prompt after starting the setup shows the publishers name. 开始安装后的安全警告提示将显示发布者名称。 So it's trusted. 因此值得信赖。 But when calling 但是打电话时

ApplicationDeployment.CurrentDeployment.CheckForDetailedUpdate()

I get the TrustNotGrantedException - User has refused to grant required permissions to the application. 我收到TrustNotGrantedException-用户拒绝向应用程序授予必需的权限。

If I add my certificate to the Trusted Publishers Store on my machine the exception is not thrown and the CA of Symantec is also added to the store. 如果将证书添加到计算机上的Trusted Publishers存储中,则不会引发异常,并且Symantec的CA也将添加到存储中。 But obviously I can't add the certificate to the Trusted Publishers Store of our clients who use the app. 但是显然我不能将证书添加到使用该应用程序的客户的“受信任的发布者商店”中。

The app is first installed from disc and at every start it checks an online update url. 该应用程序首先从光盘安装,每次启动时都会检查在线更新网址。 And if I remove the certificates from the Trusted Publishers Store afterwards the manual update still works if I try it again. 并且,如果以后我从Trusted Publishers商店中删除证书,则再次尝试手动更新仍然有效。 Are these information also stored elsewhere? 这些信息还会存储在其他地方吗?

If I don't sign the published ClickOnce app the manual update works. 如果我不签署发布的ClickOnce应用程序,则手动更新有效。 If I sign the published ClickOnce app with a self signed certificate made with makecert the manual update works. 如果我使用由makecert制作的自签名证书签署发布的ClickOnce应用程序,则手动更新有效。 So there's probably an issue with the certificate? 因此,证书可能存在问题?

How can I determine if there's a certificate issue and which steps should I do next? 如何确定是否存在证书问题,下一步该怎么做?

We are using the InPlaceHostingManager Class now. 我们现在正在使用InPlaceHostingManager类 It's made for installing or updating a ClickOnce deployment. 它是用于安装或更新ClickOnce部署的。 GetManifestAsync() fires the GetManifestCompleted event, which gives you the version number. GetManifestAsync()触发GetManifestCompleted事件,该事件为您提供版本号。 Then you can call DownloadApplicationAsync() and handle the DownloadApplicationCompleted event. 然后,您可以调用DownloadApplicationAsync()并处理DownloadApplicationCompleted事件。 So far this works and no TrustNotGrantedException is thrown. 到目前为止,此方法有效,并且不会引发TrustNotGrantedException。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM