简体   繁体   中英

Issue while installing click once application using Windows service

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?

You can try two things.

  1. Go to services, right click your service and go to properties. Under the Log On tab, check allow service to interact with desktop.

  2. Also under the Log On tab, run the service under the specific users account.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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