How to: Add and Remove Additional Assemblies
If a SharePoint package depends on other assemblies for functionality or data, you can add the assemblies to your solution package (.wsp). This way, the SharePoint server makes sure that custom assemblies are installed with a package.
You can also add and change the safe controls and class resource files associated with the assemblies.
Adding Additional Assemblies, Safe Controls, and Class Resources
You can add additional assemblies into the SharePoint solution package. Additional assemblies in a sandboxed solution deploy to the global assembly cache, but SharePoint project items in a sandboxed solution are added to the content database. You can also add safe controls and class resources to these additional assemblies. For more information about safe controls, see “Creating a SafeControl Entry” in Deploying Web Parts in SharePoint Foundation.
To add an existing assembly
Open the Package Designer. For more information, see How to: Customize a SharePoint Solution Package.
Choose the Advanced tab.
Choose the Add button, and then choose Add Existing Assembly from the list.
The Add Existing Assembly dialog box appears.
Choose the ellipsis (), and then choose the assembly that you want to add. We recommend using a relative path to the selected assembly for portability purposes.
For the Deployment Target, choose the GlobalAssemblyCache option button to deploy the assembly to the global assembly cache, or choose the WebApplication option button to deploy the assembly to the WebApplication folder on the server that's running SharePoint.
To add an assembly from project output
Open the Package Designer.
For more information, see How to: Customize a SharePoint Solution Package.
Choose the Advanced tab.
Choose the Add button, and then choose Add Assembly from Project Output from the list.
The Add Assembly from Project Output dialog box appears.
In the Source Project list, and choose the source project that you want to add.
For the Deployment Target, choose the GlobalAssemblyCache option button to deploy the assembly to the global assembly cache, or choose the WebApplication option button to deploy the assembly to the WebApplication folder on the server that's running SharePoint.
To add a safe control
Open the Edit Existing Assembly dialog box. To accomplish this, open the Package Designer, choose the Advanced tab, choose an assembly, and then choose the Editbutton.
In the Safe Controls pane, choose the Click here to add a new item button.
In the Assembly Name column, enter the name of the assembly.
In the Namespace column, enter the name of the namespace for the safe control.
In the Type Name column, enter the name of the type.
To add a class resource
Open the Edit Existing Assembly dialog box. To accomplish this, open the Package Designer, choose the Advanced tab, choose an assembly, and then choose the Edit button.
In the Class Resources pane, choose the Click here to add a new item button.
In the File Name column, choose the ellipsis (), and choose the class resource that you want to add.
Deleting Custom Assemblies
You can delete assemblies from a SharePoint package, or delete safe controls and class resources from existing assemblies.
To delete an existing assembly
Open the Package Designer. For more information, see How to: Customize a SharePoint Solution Package.
Choose the Advanced tab.
In the Additional Assemblies pane, choose the custom assembly that you want to delete.
Choose the Delete button.
To delete a safe control for an assembly
Open the Edit Existing Assembly dialog box. To accomplish this, open the Package Designer, choose the Advanced tab, choose an assembly, and then choose the Edit button.
Choose the safe control that you want to delete.
Choose the Delete key.
To delete a class resource for an assembly
Open the Edit Existing Assembly dialog box. To accomplish this, open the Package Designer, choose the Advanced tab, choose an assembly, and then choose the Edit button.
Choose the class resource that you want to delete.
Choose the Delete key.
See Also
Tasks
How to: Customize a SharePoint Feature
How to: Add and Remove Items to SharePoint Features