This is probably well documented somewhere, but I couldn't find it within 10 minutes, so I decided to blog it.
If you have a sharepoint wsp, and you want it to deploy additional dlls to a site collection's bin directory when it is deployed, then you can add a line to your cab.ddf and your manifest.xml files to make this happen. In the cab.ddf, you can add a line like
pathToDll\TheDll.dll TheDll.dll
This will put the dll in your wsp cab file. Then in your manifest.xml file, add a new assembly entry in assemblies like
<Assembly DeploymentTarget="WebApplication" Location="TheDll.dll" />
Just to clarify, I'll put examples of each file.
---cab.ddf---
; This is the file that you pass to makecab utility, as in "makecab /f cab.ddf"
.OPTION EXPLICIT ; Generate errors
.Set CabinetNameTemplate=SPInstaller.wsp
.Set DiskDirectoryTemplate=CDRom ; all cabinets go in a single directory
.Set CompressionType=MSZIP ; all files compressed in cabinet files
.Set UniqueFiles="ON"
.Set Cabinet=on
.Set DiskDirectory1=Package
Solution\manifest.xml manifest.xml
TEMPLATE\FEATURES\MyFeature\feature.xml MyFeature\feature.xml
TEMPLATE\FEATURES\MyFeature\elements.xml MyFeature\elements.xml
TEMPLATE\FEATURES\MyFeature\dwp\MyWebPart.webpart FEATURES\ArrowWebParts\dwp\MyWebPart.webpart
; this is the important part for this article
; both of the dlls are stuffed into the wsp
bin\Release\MyFeature.dll MyFeature.dll
bin\Release\TheDll.dll TheDll.dll
----manifest.xml---
<?xml version="1.0" encoding="utf-8" ?>
<Solution SolutionId="00000000-0000-0000-0000-000000000000"
xmlns="http://schemas.microsoft.com/sharepoint/" >
<FeatureManifests>
<FeatureManifest Location="MyFeature\feature.xml"/>
</FeatureManifests>
<TemplateFiles>
<TemplateFile Location="FEATURES\MyFeature\dwp\MyWebPart.webpart"/>
</TemplateFiles>
<Assemblies>
<!-- choose DeploymentTarget="WebApplication" -->
<Assembly DeploymentTarget="WebApplication" Location="MyFeature.dll">
<SafeControls>
<SafeControl Assembly="MyFeature" Namespace="MyWebParts" TypeName="*" Safe="True"/>
</SafeControls>
</Assembly>
<!-- The other dll is added with another assembly entry -->
<Assembly DeploymentTarget="WebApplication" Location="TheDll.dll" />
</Assemblies>
<CodeAccessSecurity>
<PolicyItem>
<PermissionSet class="NamedPermissionSet" version="1" Description="Permissions for WRWebParts">
<IPermission class="AspNetHostingPermission" version="1" Level="Minimal" />
<IPermission class="SecurityPermission" version="1" Flags="Execution" />
<IPermission class="WebPartPermission" version="1" Connections="True" />
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
</PermissionSet>
<Assemblies>
<Assembly Name="ArrowWebParts"/>
</Assemblies>
</PolicyItem>
</CodeAccessSecurity>
</Solution>


Also, add the safe control entry in solutionConfig.xml
Posted by: Sowmya Deenadayal | 05/19/2011 at 07:25 AM