Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm creating a WSP package in Visual Studio 2010 to deploy my feature to the Sharepoint 2007 environment on a Windows 2003 Server box. Currently, the xml file that references the assembly containing the code I have written is referenced from the GAC. What I'd like to do is make it so this WSP file will add the dll to the assembly automatically and then reference it so the feature can be properly installed. Is this possible? If so, how is this done?

I have my ListManifest.xml file as follows:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="101">
    <Receiver>
        <Name>AddedEventHandler</Name>
        <Type>ItemAdded</Type>
        <SequenceNumber>10000</SequenceNumber>
        <Assembly DeploymentTarget="GlobalAssemblyCache" Location="SPEventHandler.dll"/>
        <Class>SPEventHandler.ItemAddedHandler</Class>
        <Data></Data>
        <Filter></Filter>
    </Receiver>
</Receivers>

As you can see, it references the SPEventHandler assembly in the GAC, but I'd like the program to have my DLL included in the assembly, add it to the GAC and reference it.

Thanks for your help in advance.

My DDF file:

.OPTION Explicit ; Generate errors
.Set DiskDirectory1="..\bin"
.Set CabinetNameTemplate="ChangeContentType.wsp"

manifest.xml
.Set DestinationDir="List\ListTemplates"
List\ListTemplates\ListManifest.xml ; specify cab file name
.Set DestinationDir="List\Messages"
List\Messages\schema.xml
.Set DestinationDir="List"
List\Feature.xml
..\bin\SPEventHandler.dll SPEventHandler.dll

manifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/"
   SolutionId="F9850E13-81B6-47E1-BBC6-42AC70A903C3" >
   <FeatureManifests>
       <FeatureManifest Location="List\Feature.xml"/>
   </FeatureManifests>
</Solution>
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

If you are packaging your wsp manually, then you need to include your dll in your DDF file, e.g.

bin\Debug\MyFile.dll MyFile.dll

and you include the assembly in the solution manifest, e.g.

<Assemblies>
  <Assembly DeploymentTarget="GlobalAssemblyCache" Location="MyFile.dll" />
</Assemblies>

Here is an MSDN reference

If you do not want to do this manually, you can take a look at WSPBuilder.

share|improve this answer
    
Thanks, Laurie! –  Music Magi Jun 3 '11 at 18:57
    
I added my ddf file to the original question text. Do I just add the line for the DLL at the bottom or do I need to do a .Set DestinationDir="" ? –  Music Magi Jun 3 '11 at 19:05
1  
Just add the line to the bottom of your DDF. –  Laurie Jun 3 '11 at 19:08
1  
The path should be to the bin folder in your project. Make sure that the dll is in that folder. –  Laurie Jun 3 '11 at 19:17
1  
You can verify that the dll is in your wsp by renaming it to .cab and extracting the files. As far as the Assembly node, that belongs in the manifest.xml file and should not have a path in it. Take a look at the MSDN instructions for where to put that node. –  Laurie Jun 3 '11 at 20:41
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.