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 have sp project (say project a) in visual studio that is supposed to deploy the sp solution to my website (say that its running at http://localhost:xxxx/).

My goal would be to add the list definition to the above project.

To get the list definition I follow steps mentioned in the following post: Getting an existing list definition in sharepoint 2010. In short, I create my lists using my web browser, save the site as template (wsp), and import it to another vs solution (project b).

Now project b has the definition of the two lists that I want. How to get those definitions into project a? Are we supposed to do something like Add Existing Item... here? If so what must I import?

share|improve this question
    
Are you trying to manually copy a list definition from project b to project a, or do it in code? –  CigarDoug Mar 14 '13 at 14:14
    
Copy the list item from the Visual Studio solution package and change the GUID of the list item and rebuild the package. –  Ram Jul 4 '13 at 13:43

1 Answer 1

Save the site containing the list as a template. Site Settings -> Site Actions -> Save site as template.

In Visual Studio add a new project and select the project type "SharePoint 2013 - Import Solution package".

A wizard will start enabling you to (un)select all needed lists, content types, site columns, etc... After the wizard is done, the selected items will be imported into your Visual Studio project.

Be careful when deploying. If you deploy the solution to the site with the original lists etc you will get conflicts concerning duplicate ID's.

share|improve this answer
    
FYI importing content types and site columns can be done directly in SharePoint by using the Server Explorer. Create a SharePoint connection, browse to the the content type or site column, right click and select "Import ..." –  W0ut Dec 24 '13 at 9:00

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.