Sumeshk
Sumeshk

Reputation: 1988

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?

Upvotes: 0

Views: 640

Answers (1)

bf.v.rooyen
bf.v.rooyen

Reputation: 33

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!

Upvotes: 1

Related Questions