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

(SharePoint 2010)

I have created 4 webparts each in their own solutions and they work great. How could I add each webpart to an empty solution and deploy them as one feature & have each web-part available indiviually . Everything I read on how-to gives steps that seem incorrect and are very different from each other.

-I think I 'add existing items' and add the .webpart file [would I need anything else? .cs? .wsp?]

-then add a new feature & give it a element for each .webpart

-will I need to edit the manifest.xml? or anything else?

share|improve this question
add comment

3 Answers

This is how I would do it:

  1. Create a blank solution (sln).
  2. Create a SharePoint project to hold the Web Parts (this will also be one single WSP).
  3. Use Add Existing Project... to add the Web Part projects to your solution (sln).
  4. In your new SharePoint project create a Feature.
  5. Add the Web Parts to the new Feature.

Now you will have a completely separate setup which will generate one single WSP and have one single Feature without altering the existing setup. So you could still build from the old setup if you want separate Web Parts.

share|improve this answer
add comment

If you are using Visual Studio 2010, you should just create each WebPart in the solution and add those to a single Feature.

share|improve this answer
add comment

Create an empty folder inside your solution with Web Part Name and use "Add Existing Items", Browse to other web parts and inside the webpart folder select everything including .webpart, .cs, .ascx.cs, .ascx.designer.cs, .xml, .spdata !

This should make the Folder look like a Web Part container with all the files and it should be added automatically to the feature as well...

Let me know if you need more explanation on this!

share|improve this answer
add comment

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.