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>
SPEventHandler, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=f2e7de6c4a924a03
</Assembly>
<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开发者_JAVA技巧 advance.
You didn't specify which version of sharepoint but here is an article on how include extra assemblies in your package for sharepoint 2010
http://blog.mastykarz.nl/including-additional-assemblies-wsp-visual-studio-sharepoint-development-tools/
Solution:
If you are packaging your wsp manually, then you need to include your dll in your DDF file, 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>
MSDN Reference
精彩评论