I have been having an issue with 'Trust Not Granted' out of no where. I have been deploying my app for a few years many many times. Out of the blue, I am having a strange issue where the same key I have been using forever, which doesn't expire until the year 3000 is giving me problems. Or is it? Is something else to blame? The key has been installed in the proper certificate stores as always.

Here is the weirdest part: I publish the application and then make two IIS virtual applications pointing to the same physical location. When I try to view them, one says trust not granted the other does not.. it just works as expected.

So finally, it seems like the key isn't the issue, but something with IIS. Does this ring any bells?

I recall a long time ago the coworker that wrote this originally had to edit some machine key in a xml file, but that has not changed in forever. What could be the culprit?

the Trust Not Granted has this for the errors in the detailed log:

ERROR DETAILS

Following errors were detected during this operation.
* [5/18/2012 1:15:40 PM] System.Deployment.Application.TrustNotGrantedException (Unknown subtype)
    - User has refused to grant required permissions to the application.
    - Source: System.Deployment
    - Stack trace:
        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 MS.Internal.AppModel.XappLauncherApp.AssertApplicationRequirementsAsync(Object unused)
* [5/18/2012 1:15:40 PM] System.Deployment.Application.DeploymentException (Unknown subtype)
    - The AssertApplicationRequirements method failed. The application cannot be committed.
    - Source: System.Deployment
    - Stack trace:
        at System.Deployment.Application.DeploymentManager.WaitForAssertApplicationRequirements()
        at System.Deployment.Application.DeploymentManager.SynchronizeCore(Boolean blocking)
        at System.Deployment.Application.DeploymentManager.SynchronizeAsyncWorker()
1

There are 1 answers

4
RobinDotNet On

I talked to a ClickOnce guy at Microsoft about this issue. He thinks this has nothing to do with the machine key, it has everything to do with the certificate and the signing.

Why are you creating two IIS virtual directories? Are you saying if you run it on the same machine it works differently on two different IIS virtual directories? When you publish the app, what is the installation URL? Is the domain the same on the two virtual directories?

Are you running and targeting .NET 4 or .NET 3.5?

The computer you're running the app on -- is it the same one it's always worked on, or has it been changed? This could have something to do with the certificate installed on the user computer.