简体   繁体   中英

Packaging multiple features into a single WSP solution file

I am working on a sharepoint feature which includes a couple of list definitions, 2 webparts, a feature receiver assembly and an InfoPath form.

I have to use WSPBuilder to package these, and the requirement is to package all these features into a single WSP solution file.

Now, WSP builder requires the deployment files in a particular folder structure, same as the 12 Hive of sharepoint.

My problem is that all my features were developed separately, and consist of multiple project files, and these are not necessarily in the same folder structure..

How do I use WSP Builder to package multiple features into a single WSP solution?

Maybe this will help: http://www.codeplex.com/wspbuilder/Thread/View.aspx?ThreadId=43125

Ultimately, I think you gain a lot of flexibility by building your own wsp files by using a tool like NANT.

There's no particular action you need to undertake in wspbuilder to have multiple features in the same solution package. All you need to do is create a new folder for each feature under the 12\\TEMPLATE\\FEATURES folder inside your solution in Visual Studio and place the appropriate feature.xml file in that folder. For example, you may have:

12\\TEMPLATE\\FEATURES\\FancyFeature\\feature.xml 12\\TEMPLATE\\FEATURES\\ReallyCoolFeature\\feature.xml

... and so on.

Upon building the solution, wspbuilder will read the entire tree structure of your 12 folder and append the corresponding nodes in the wsp's manifest.xml file. The same goes for any other possible subfolders inside the "TEMPLATE" folder, including IMAGES, LAYOUTS, etc: at deployment time they will all be copied in the correct folder inside the real 12 hive, because the 12 folder inside your solution is meant to be a replica of the original one.

For a better understanding, create some folders and files inside your 12 folder in the visual studio solution, compile your project and look inside the generated manifest.xml file.

我在向wsp添加dll时遇到了麻烦,所以我写了一篇关于它的简短文章: 如何将DLL添加到WSP解决方案中

I usually have one project in the solution designated as the "main" one. I set the dependencies so that this "main" project is built last. Then for the other projects that I want to be included in the wsp package, I edit the "Post Build Events" to xcopy the contents of the 12 folder and that dlls built by the projects into corresponding folders for the main project. Then after I build the whole solution, I can build the wsp package for the main project and know that it contains everything.

The simple answer is that you are going to have to copy all the files form the individual projects into one master project for your solution. As long as all your individual feature files are in the correct location in your '12' folder then you'll be good to go.

Note: You'll need to check all your references to any assemblies as this solution will create 1 assembly for all your custom logic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM