0

I tried to install a click once application from my own windows service using InPlaceHostingManager

added code to install the application while starting the service but an exception throws

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.InPlaceHostingManager.AssertApplicationRequirements(Boolean grantApplicationTrust) at System.Deployment.Application.InPlaceHostingManager.AssertApplicationRequirements() at WindowsService1.ClickOnceInstaller.iphm_GetManifestCompleted(Object sender, GetManifestCompletedEventArgs e)

the code works fine when calling from a sample windows application.

How can i solve this?

4

1 回答 1

1

你可以尝试两件事。

  1. 转到服务,右键单击您的服务并转到属性。在登录选项卡下,选中允许服务与桌面交互。

  2. 同样在“登录”选项卡下,在特定用户帐户下运行该服务。

希望这可以帮助!

于 2013-08-28T06:35:51.020 回答