This documentation is archived and is not being maintained.

How to: Remove Permissions from Folders and Assemblies

There are two ways to remove trust from folders and assemblies in Visual Studio Tools for Office projects:

  • Delete the code group that grants the permissions from the Microsoft .NET Framework security policy.

  • Set the properties of the code group so that it grants no permissions.

Removing permissions does not take effect immediately. All users must quit and then restart all Office applications before security policy changes are enforced. Check Task Manager to make sure there are no instances of Microsoft Office applications. Other applications that host Microsoft Office applications can also prevent the new permissions from being enforced. Users should quit all applications that use Microsoft Office, hosted or stand-alone, when security policies are changed.

To remove permissions by deleting code groups

  1. In Control Panel, open Administrative Tools.

  2. Run Microsoft .NET Framework 2.0 Configuration.


    There might be several similar tools with names that start with Microsoft .NET Framework. Make sure that the configuration tool you use matches your version of the runtime.

  3. In the treeview on the left side, expand Runtime Security Policy, expand User, expand Code Groups, expand All_Code, and then expand VSTOProjects.


    If you want to modify a network location such as a share or a website, you do the modification at the Machine level instead of the User level. You must have administrator privileges to modify Machine-level policy.

  4. Select the code group that you want to remove, open the Action menu, and then click Delete.

You can also delete the entire VSTOProjects node and all its contents, so that no Office solutions that use managed code extensions can run. A new VSTOProjects node is created the next time you build a Visual Studio Tools for Office project.


If you delete a code group that Visual Studio generated, the code group will be regenerated the next time you open the project and rebuild it. If you delete the code group while the project is open, Visual Studio will not regenerate the code group until you close the project and then reopen it.

To remove permissions by changing code group properties

  1. Expand the VSTOProjects node as described above.

  2. Right-click the code group you want to change, and then click Properties in the shortcut menu.

  3. In the Properties dialog box, click the Permission Set tab.

  4. Select Nothing in the Permission Set list.


    Any permission set that is not FullTrust prevents the assembly from running.

  5. Click OK.

See Also