Udostępnij za pośrednictwem


How to: Remove Permissions from Folders and Assemblies (2003 System)

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Document-level projects

  • Application-level projects

Microsoft Office version

  • Microsoft Office 2003

For more information, see Features Available by Application and Project Type.

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 ensure 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.

    The Microsoft .NET Framework 2.0 Configuration tool is not included with Visual Studio 2008. To install the tool, you must download and install the .NET Framework 2.0 Software Development Kit (SDK) from the Microsoft Download Center. For an example, see .NET Framework 2.0 Software Development Kit (SDK) (x86).

  3. In the tree view panel, expand Runtime Security Policy, expand User, expand Code Groups, expand All_Code, and then expand VSTOProjects.

    Note

    If you want to modify a network location such as a share or a Web site, 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.

  5. On the Action menu, 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.

Note

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 on the shortcut menu.

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

  4. Select Nothing in the Permission Set list.

    Note

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

  5. Click OK.

See Also

Tasks

How to: Grant Permissions to Folders and Assemblies (2003 System)

Concepts

Security Requirements to Run Office Solutions (2003 System)

Best Practices for Security in Office Solutions (2003 System)

Specific Security Considerations for Office Solutions

Code Groups

Securing Applications

Other Resources

Security in Office Solutions (2003 System)