Clickonce更新错误 [英] Clickonce update bug

查看:60
本文介绍了Clickonce更新错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!



我有一个应用程序,上个月有一个错误,我已经无法解决问题。



该应用程序是一个仓库/生产WPF应用程序,并通过大约100台Windows 7计算机发布到非Internet连接的LAN。该应用程序处于快速开发周期,每年最多有100个更新版本。该应用程序还具有静默后台更新程序,可更新应用程序并在完成重新启动提示时通知用户。应用程序部署到网络共享,其中installtion和update文件夹设置为完全限定的路径。但是,用户可以选择从他的文件资源管理器中的网络工作站安装应用程序,因为相同的共享也被映射为此。只要设置了更新位置,我读过这个就不用担心了。



错误是我们收到的消息用户拒绝了在我们执行更新版本检查时授予访问应用程序所需的权限。我们一直在尝试后台和前台更新,我们最近也尝试了这个:



 ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment; 

var appId = new ApplicationIdentity(deployment.UpdatedApplicationFullName);
var unrestrictedPerms = new PermissionSet(PermissionState.Unrestricted);
var appTrust = new ApplicationTrust(appId)
{
DefaultGrantSet = new PolicyStatement(unrestrictedPerms),
IsApplicationTrustedToRun = true
Persist = < span class =code-keyword> true
};

ApplicationSecurityManager.UserApplicationTrusts.Add(appTrust);





没有成功。





我们的更新代码如下:

  if (ApplicationDeployment.IsNetworkDeployed)
{

ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;

var appId = new ApplicationIdentity(deployment.UpdatedApplicationFullName);
var unrestrictedPerms = new PermissionSet(PermissionState.Unrestricted);
var appTrust = new ApplicationTrust(appId)
{
DefaultGrantSet = new PolicyStatement(unrestrictedPerms),
IsApplicationTrustedToRun = true
Persist = < span class =code-keyword> true
};

ApplicationSecurityManager.UserApplicationTrusts.Add(appTrust);

try
{
info = deployment.CheckForDetailedUpdate();

}
......





并且它始终因TrustNotGrantedException而失败,以上信息。即使我发布更新而不更改代码库。

解决方案

http://stackoverflow.com/questions/23239460/clickonce-deployment-auto-update-is-not-working [ ^ ]


< blockquote>检查此线程的配对,它解释了TrustNotGrantedException的原因:



Clickonce应用程序完全信任更新失败,在Windows上出现TrustNotGrantedException 8 [ ^ ]


Hello!

I have an application wich the last month have gotten a bug i have been unsucessfull in solving.

The application is a warehouse/production WPF application and is published to an non-internet connected LAN with around 100 Windows 7 Computers. The application is in rapid development cycle and have upto 100 update versions a year. The application also have an silent background updater which updates the app and notifies the user when finished with a restart prompt. The application is deployed to a network share wich have installtion and update folder set to the fully qualified path. However the user can chose to install the app from a Network station in his file explorer, since the same share also is mapped as this. This i have read should not be of any concern as long as the update location is set.

The bug is that we have been getting the message "The user has refused to grant required permissions to access to the application" when we perform the check for updated version. We have been trying both background and foreground update, and we also recently tried this:

ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;

               var appId = new ApplicationIdentity(deployment.UpdatedApplicationFullName);
               var unrestrictedPerms = new PermissionSet(PermissionState.Unrestricted);
               var appTrust = new ApplicationTrust(appId)
               {
                   DefaultGrantSet = new PolicyStatement(unrestrictedPerms),
                   IsApplicationTrustedToRun = true,
                   Persist = true
               };

               ApplicationSecurityManager.UserApplicationTrusts.Add(appTrust);



without success.


Our update code is this:

 if (ApplicationDeployment.IsNetworkDeployed)
            {

                ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;

                var appId = new ApplicationIdentity(deployment.UpdatedApplicationFullName);
                var unrestrictedPerms = new PermissionSet(PermissionState.Unrestricted);
                var appTrust = new ApplicationTrust(appId)
                {
                    DefaultGrantSet = new PolicyStatement(unrestrictedPerms),
                    IsApplicationTrustedToRun = true,
                    Persist = true
                };

                ApplicationSecurityManager.UserApplicationTrusts.Add(appTrust);

                try
                {
                    info = deployment.CheckForDetailedUpdate();

                }
......



and it always fails with a TrustNotGrantedException and the above message. Even if i publish an update without changes to the code base.

解决方案

http://stackoverflow.com/questions/23239460/clickonce-deployment-auto-update-is-not-working[^]


Check this thread out mate, it explains the cause of the TrustNotGrantedException:

Clickonce app full trust update failing with TrustNotGrantedException on Windows 8[^]


这篇关于Clickonce更新错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆