Condividi tramite


How to: Determine the Permissions for a ClickOnce Application

Although you can deploy a ClickOnce application with default permissions, it is a good practice to restrict the application to only those permissions that it actually needs. You can analyze your application to determine which permissions it needs by running the Permission Calculator tool, accessible from the Security page of the Project Designer.

Note

There are some limitations to the Permission Calculator tool. The tool performs a static analysis of the code and cannot determine permissions required for late-bound code or for dynamically loaded assemblies. In addition, if you have designed your application to dynamically modify its permission demands when running in an environment with lesser permissions, the tool will report the maximum required permissions.

To determine permissions for an application

  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. Click the Calculate Permissions button.

    Note

    Any existing permission settings will be overwritten.

    The Permission Calculator will analyze the application; on completion the Permissions required by the application table will be updated to reflect the permissions used by the application.

    Note

    For large projects, this process could take several minutes.

See Also

Tasks

How to: Set Custom Permissions for a ClickOnce Application

Concepts

Code Access Security for ClickOnce Applications

ClickOnce Deployment and Security

ClickOnce Deployment Overview

Other Resources

Securing ClickOnce Applications