none
ClickOnce TrustNotGrantedException exception RRS feed

  • Question

  • Hi,

    There is windows forms application, whick is deployed using ClickOnce.  

    For some reason some clients (5 of >100) experience problems with ClickOnce update, method  CheckForUpdate fails with TrustNotGrantedException exception. Application is signed with "real" certificate. 
    Any idea what can be the reason?

    Unfortunately I cannot reproduce the problem locally.

    OS version: Microsoft Windows NT 6.1.7601 Service Pack 1

    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.ApplicationDeployment.CheckForDetailedUpdate(Boolean persistUpdateCheckResult)   at System.Deployment.Application.ApplicationDeployment.CheckForUpdate()



    Alexander

    Wednesday, March 19, 2014 2:42 PM

Answers

  • Hi,
    A client machine exposes a wide variety of resources that a managed application can have access to, including the file system, the Registry, printing services, the user interface, reflection, and environment variables. Before a managed application can access any of the resources on a client machine, it must have .NET Framework 3.0 Code Access Security (CAS) permission to do so.
    Ref: http://msdn2.microsoft.com/en-us/library/ms743612.aspx#Common_Language_Runtime_Security
    You’d better follow steps below to fix your issue:
    1. Try to a new certificate in ClickOnce deployment application.
    2. Using the Code Access Security Policy Tool to add code access security.
    For example:

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CasPol -q -machine

    -addgroup All_Code -url http://localhost/MyTestApp/* FullTrust

    -n MyTestApp -polchgprompt off

    I think you could refer to this Akshay's Blog about ClickOnce Deployment failed due to improper trusts:

    http://blogs.msdn.com/b/akshayns/archive/2007/05/02/clickonce-deployment.aspx
    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 20, 2014 9:00 AM
    Moderator