Learn more about SQL Server tools

mssqltips logo

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories


Deploying a List Definition via Visual Studio .Net 2010

By:   |   Read Comments   |   Related Tips: > Sharepoint

Free Webcast - Simplify SQL Server Administration


Creating a list instance from "Out of the box" predefined SharePoint lists is easy but limited. How about creating our custom list via Visual Studio .Net 2010?


List definitions and list instances that are based on those definitions are a fundamental part of Microsoft SharePoint 2010. Microsoft Visual Studio 2010 provides a project type that makes it easier to create list definitions in XML and to create list instances that are based on those definitions. In addition, tight integration with SharePoint 2010 enables you to deploy list definitions and list instances to a SharePoint site directly from Visual Studio 2010. Let's follow the below steps :

Open Visual Studio .Net 2010 > File (Menu) > New > Project  :

start page

Under Installed Templates, expand "SharePoint" and select "2010" from the left side panel. > Select "Empty SharePoint Project" from the right side panel. Type a name for your project, then click the OK button.

new project

Type the URL of your local SharePoint site at the "What local site do you want to use for debugging?" textbox and choose "Deploy as a farm solution" (Differences between Farm & Sandbox Solutions) .

customization wizard

Click on the "View" menu > Solution Explorer > right-click at the created solution > Add > New Item :

solution explorer

Select "2010" for SharePoint under "Installed Templates" from the left side panel > select "List Definition" from the right side panel :

online templates

Keep/Edit the display name of the list definition , Select "Custom List" as the type of the list definition and check "Add a list intance for this list definition":

choose list definition settings

As seen below is our solution with the created custom list definition and added list instance.

solution explorer

Right click at "ListDefViaVS2010" project then select "Deploy" in order to deploy our solution to the SharePoint site then wait till we check that the output is successfully deployed:


Now let's go to the SharePoint site to check the deployed custom list definition , Click "Site Actions" menu then "View All Site Content":

site actions

As we can see below a new added list instance to our custom list definition "ListDefViaVs2010 - ListInstance1".

content and structure reports
Next Steps

Last Update:

next webcast button

next tip button

About the author

Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Notify for updates 

Send me SQL tips:


Learn more about SQL Server tools