SharePoint Solution Generator, part of Visual Studio 2008 extensions for Windows SharePoint Services has been a fantastic tool in SharePoint 2007 development when I needed to create a list definition and list instance quickly.
All you had to do was to create your content types,site columns, and list using SharePoint UI and apply the content types and site columns to your list, then customise your list and create views then finally point solution generator to your list and create your solution package.
Combination of the new features of SharePoint 2010 and Visual studio 2010 means no more messing around with add-ons….
SharePoint 2010 allows you to save your site as a wsp package and Visual studio allows you to import the wsp package and select the required elements to include in your solution package! sounds easy? it is :)
…so first you need to create your list as before with all required components and customisations:
1) Create your Site Content Type
2) Create your Site Columns
3) Assign your site columns to your content type
4) Create your list/library and assign your content type to your list
To be able to do this you need to ensure you have selected “allow management of content types” from the list advanced settings
5) Save your site as WSP package
Site Action –> Site Settings –> “Save site as template”
provide a file name and a template name for your template
Download the WSP file and save locally
6) Import the WSP package into Visual Studio 2010
Create a Visual Studio SharePoint project and select “Import SharePoint Solution Package”
Import the WSP file
Specify the project elements required in this case the list template
The easiest way to do this is to highlight all items (Ctrl + A) and deselect one item. this will uncheck all boxes
Then select the “List instance” and “Content type” and click finish (You do not need to include the columns)
Say No to include all dependent items
Now you have all required components for your solution
There are a number of considerations which I will try to cover in the next posts such as including Lookup and Managed Metadata filed types in your solution.