Note: The code above runs synchronously and blocks your application. To avoid this, you could run it in as a task on the thread pool with Task.Run() or you could use XElement.LoadAsync instead of XElement.Load(), if available.
There should be five subkeys, one for each security zone:
Each subkey can have one of the following values:
Disabled: No trust prompt is shown, instead you get the error message above.
Enabled: A trust prompt is shown.
AuthenticodeRequired: A trust prompt is shown only for signed applications (other applications cannot be installed).
Trust prompt example
If the application you’re trying to install has been published on the Internet, you’ll want to set the Internet subkey to “Enabled” (or to “AuthenticodeRequired” if the application has been digitally signed). You should then see a trust prompt instead of the “your administrator has blocked this application” error:
It allows you to easily display and modify the trust prompt configuration.
If you don’t trust yourself or other people using your PC, you can change the respective zone setting back to “Disabled” after installing the ClickOnce application. The trust prompt configuration has no effect on installed applications and their updates.
You could also add the publisher’s site to your trusted sites and only enable trust prompts for the TrustedSites subkey.
Are you wondering why all your trust prompt settings have been changed to “Disabled”? Unfortunately, I have no idea. I’ve had this happen on multiple PCs and I’m pretty sure I didn’t do this myself.