Create List Instance Feature for SharePoint 2010 in Visual Studio

Create a new Link list with pre-populated list items as a feature-based solution.

1. Lets create a SharePoint 2010 list instance feature with Visual Studio. Create a New Empty SharePoint Project, Give it a name, I’ve named it as Crescent.Portal.DashboardLinkssharepoint 2010 list instance visual studio

2. In the next dialog box, Select either Farm solution or Sandboxed solution whichever applicable to your requirements. I’ve selected “Deploy as a Farm Solution”

3. Right click the Project in visual studio solution explorer >> Add >> New Item >> List Instance to  create new SharePoint 2010 list using visual studio
sharepoint 2010 create list instance visual studio
 4. Enter the List Instance settings: Link List Name, List to Instantiate, URL. Click Finish.
sharepoint 2010 create list visual studio

5. Now our project will look like the below screen. Look at the “FeatureId” attribute. This is the Feature ID of the Link List feature. In case, If you want to create a List instance for your own List definition, You can use the Feature ID of the particular List. (You can just get into 14 Hive, Templates and pick the relevant feature folder’s Feature.xml file to get the feature Id)

sharepoint 2010 c# create list instance

6. Rename the Feature from “Feature1” to “DashboardLinks” in solution explorer. Get into the Feature designer (Right click the “DashboardLinks” and choose “View Designer”), Give it a meaning full title (Here I’ve given “Dashboard Links Feature”) that will appear on the site features page. Add the DashboardLinks ListInstance Element to the feature.
create a list instance sharepoint 2010
7. Our requirement is to Pre-populate the Dashboard Links list. So, let’s add the <Data> element with values to the Elements.xml as below:
SharePoint 2010 list instance elements.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">
  <ListInstance Title="Dashboard Links"
          <Field Name="URL">, PMO Dashboard</Field>
          <Field Name="Comments">PMO Dashboard Link</Field>
          <Field Name="URL">, Functional Dashboard</Field>
          <Field Name="Comments">Functional Dashboard Link</Field>
          <Field Name="URL">, Operational Dashboard</Field>
          <Field Name="Comments">Operations Dashboard Link</Field>

8. Build and deploy the Project (Just right click the Project in visual studio, choose Build and then choose Deploy)

9. Verify the feature is activated by going to Site actions >> Site settings >> Manage Site features (Under Site actions tab)
 sharepoint 2010 list instance feature
10. See it in action! List created in SharePoint using Visual Studio 2010 feature.sharepoint 2010 create list instance

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

8 thoughts on “Create List Instance Feature for SharePoint 2010 in Visual Studio

  • One query- every time deploy this feature it deletes the existing list instance(along with its records) and creates a new instance. due to which I loose the existing data. How can I only update the changes while I re-deploy the feature?

    • Instead of Declarative(XML) way, Use Feature Receiver code to Check if the list already exists and update!

  • Hey!
    I created list instance step by step as the above guide. but my created list instance don’t show on home page in sharepoint server 2010. Although the feature is activated!
    can anybody help me?

    • Hi there,
      When you create a list, it will not be placed in home page by default. You have to do it either manually or programmatically.

  • Hello Salaudeen,

    thanks for your quick response, but it doesn’t resolve my problem. If I would do it the way you described, it would fix my solution allways to special web: “/pageLib/myPage.aspx” (for site’s level) or “/myWeb/mySubWeb/pageLib/myPage.aspx”. I hope you know what I mean, I have allway exactly to determine the Url.

    I’ve played around a little last days, and figured out that I can probably solve it, by using “$resource:” to build my urls dynamically. But I’ve not found a placeholder like “$ressource:wss_currenweburl” or something like this, yet.

  • ~site or ~sitecollection tokens can not be used directly in Link lists.
    If you are in site and want to link to current site’s list/library, use: /lists/list-name/AllItems.aspx

  • Hi,

    i have a question to this row:, PMO Dashboard

    how can i create a link, which refers to a page, which lies in a pagelib in the same web where i activate my list intance feature? is there a place holder like ~site or ~web. so it finally looks like this:

    ~currentWeb/custompagelib/mypage.aspx, Foo Boo

  • Yes – nice article.



Leave a Reply

Your email address will not be published. Required fields are marked *