How to: Set Custom Permissions for a ClickOnce Application


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at How to: Set Custom Permissions for a ClickOnce Application.

You can deploy a ClickOnce application that uses default permissions for the Internet or Local Intranet zones. Alternatively, you can create a custom zone for the specific permissions that the application needs. You can do this by customizing the security permissions on the Security page of the Project Designer.

To customize a permission

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.

  2. Click the Security tab.

  3. Select the Enable ClickOnce Security Settings check box.

  4. Select the This is a partial trust application option button.

    The controls in the ClickOnce security permissions section are enabled.

  5. From the Zone your application will be installed from drop-down list, click (Custom).

  6. Click Edit Permissions XML.

    The app.manifest file opens in the XML Editor.

  7. Before the </applicationRequestMinimum> element, add XML code for permissions that your application requires.

    System_CAPS_ICON_note.jpg Note

    You can use the ToXml method of a permission set to generate the XML code for the application manifest. For example, to generate the XML for the EnvironmentPermission permission set, call the ToXml method. For more information about the structure of the permission set XML, see NIB: How to: Import a Permission Set by Using an XML File.

Securing ClickOnce Applications
Code Access Security for ClickOnce Applications
Securing ClickOnce Applications