How to create a custom SharePoint list definition using Visual Studio 2012

In this article you will learn how to create a custom list definition (not a list instance) using the Visual Studio 2012 visual designer with step-by-step with screenshots.

In Visual Studio 2012 select File | New Project

Select Templates | Visual C# | Office/SharePoint | SharePoint 2013 – Empty Project


If you don’t see this type of project available then you may need to download and install the Microsoft Office Developer Tools for Visual Studio 2012

Provide a name and location for the project/solution and OK

In the SharePoint Customization Wizard Prompt, configure the server to use for developing/debugging. If possible you will want to try and achieve a Sandboxed solution over a Farm Solution due to it’s ability to be able to be reused in more scenarios requiring less permission is the SharePoint environment.


Once the new solution has been created, we can use the new Visual Designer to create the List Definition. Right click the project in the solution explorer and select Add | New Item


Select Visual C# Items | Office/SharePoint | List, provide a name and click OK


Provide a display name for the list. We just want to create a list definition, not an instance of the list; This isn’t an option so what we do instead is go with the “Create a customizable list template and a list instance of it” and we will make some mods to the generated project files to remove the list instance so we are just left with the definition.


You should now see the list instance and definition files in solution explorer.


If you select the SettingsProfile in the solution explorer you will get the new List Visual Designer. Notice the “List” tab, this represents the instance of the list.


Since we only want the list definition, we are going to delete the list instance files from solution explorer. Select SettingProfileInstance, right-click and Delete.


You should now be left with just the list definition, the “List” tab will now be greyed out.


We can now get on with creating the list definition and there are plenty of articles out there on the finer points of doing this. Here are some for reference:


Just for completeness if you are following this through I’ve added a couple of columns to my definition.


Now lets deploy it to SharePoint to make sure it works

Double click the Feature in solution explorer to bring up the feature visual designer and package explorer

Here you can set options such as how the feature appears and it’s scope. For our purposes just confirm the items in the feature include just the list definition files.


Now select the project, right-click and Deploy


Once the solution has been deployed I’m going to navigate to my site in a browser and verify that the new solution has been deployed and the feature activated (by default the solution is deployed and activated, and the feature is scoped at a web level and activated). You should see messages in the Visual Studio status bar to this effect during the deployment.





Everything is now is place for us to create an instance of the list from the definition, so I’ll create a new app and select our Widget Settings Profile app (list definition).


Provide a name for the new list instance based on our custom list definition.


We can now create items in the list and we see our columns coming through that were defined in the custom list definition.


Job complete, in this article we went through creating a list definition using the Visual Studio 2012 SharePoint 2013 List project template. We manually deleted the default list instance files so that we were just left with the list definition in our solution.

About Cameron Dwyer

Architect and developer at OnePlace Solutions. Passionate about delivering compelling solutions on the Office 365/SharePoint platform. Addicted to coffee.

Posted on September 20, 2013, in Office 365, SharePoint and tagged , , , , , . Bookmark the permalink. 10 Comments.

  1. Nice post. I have also created a list as same
    Only one concern. I am not able to create Lookup field using ListDefinition Desginer.


  2. Good Post. I also created site definition and deploy then create new item , I couldn’t input new item , so as to reslove this issue, I tried to open schema.xml with visual studio 2012, there shows some properties are not declared, but I don’t know how to declare some properties on schema.xml


    • Your problem sounds very specific to the site definition that you have created and sounds like there are mandatory properties (that must be included in the schema) that are missing. A suggestion that comes to mind is to try SPCAF. It has a free module called SPCop that validates a lot of SharePoint rules (especially in SharePoint xml files) and will pick up a lot of these types of issues before you get to putting it onto your SharePoint server. If it picks up errors they should be more meaningful than the errors SharePoint is throwing at run time.


  3. its good one….
    now i have known the purpose of list definition….

    thanks for such kind of post


  4. Thanks Cameron. Its a rellay good post.
    Do you know how can i set a lookup column delete cascade?


  5. Very helpful Cameron…Thank you.

    I have a requirement for my company where I need to create a web part that displays articles from any list on the intranet. For the articles to be displayed correctly with Read More link at the bottom of the short description, I point to a JS file store in /_catalogs/masterpage gallery. My thinking is to create a list definition then with when ever a person creates an instance of the list, that JS link should be hardcoded already so that end users with little to no SharePoint Dev experience can use it. Your help will be appreciated.


  6. Its really very useful and gives very good clarity. Thanks


  1. Pingback: Convert doc/docx Files To PDF In SharePoint 2013 Using Word Automation Services | jared meredith

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: