How to: Set a Security Zone for a ClickOnce Application
When setting code access security permissions for a ClickOnce application, you need to start with a base set of permissions. One way to do this is by setting a security zone to populate the Permissions required by the application table.
In most cases, you will want to start with no permissions and add the permissions required by your application one at a time; you can do so by choosing the Custom security zone.
You can also choose the Internet zone which contains a limited set of permissions, the Local Intranet zone which contains a greater set of permissions, or the Local Computer zone which will enable Full Trust permissions. When choosing one of these zones, you should further customize the permission set to include only the permissions actually required by your application. For more information, see How to: Set Custom Permissions for a ClickOnce Application.
You can set the security zone on the Security page of the Project Designer.
To set a security zone
With a project selected in Solution Explorer, on the Project menu click Properties.
Click the Security tab.
Select the Enable ClickOnce Security Settings check box.
Select the This is a partial trust application option button.
The controls in the ClickOnce security permissions section are enabled.
In the Zone your application will be installed from drop-down list, select a security zone.
The Permissions required by the application table will be updated to reflect the default permissions for the selected zone.
Note
Switching between zones will preserve any permission settings that you have already modified.
See Also
Tasks
How to: Set Custom Permissions for a ClickOnce Application
Concepts
Code Access Security for ClickOnce Applications
ClickOnce Deployment and Security