Learn to use SharePoint Project Items
By Phil Jirsa
July 9, 2012 —
(Page 1 of 2)
SharePoint Project Items, or SPIs, are a key ingredient to any SharePoint solution created with Visual Studio. They are templates of reusable components that can be easily added to your SharePoint project to add specific functionality. Even more than that, they ultimately become the element manifests of the feature definitions that make up your SharePoint Solution Package. Learning the capabilities and purposes of these items is important to creating a streamlined and maintainable solution for your SharePoint environment.
Let’s take a closer look behind the scenes of a SharePoint Project Item. First, we can create a sample SharePoint project to work with. Open Visual Studio and create a new empty SharePoint project. You can call it whatever you like. Mine is called SharePointProject1.
Right-click the project folder from the Solution Explorer and choose “Add,” then “New item.” Next, select the SharePoint group. All of the items you see here are SharePoint Project Item templates. Each of these items can help us easily create a certain type of element or artifact for our SharePoint project and let us customize them as necessary.
Choose to create a new Visual Web Part by selecting that item, giving it a name, and then clicking “Add.” Visual Studio will now create a new SPI for our Visual Web Part in our project.
Next, if we look at the Solution Explorer, we’ll see that we now have a feature to deploy our item, called Feature1. Click on the VisualWebPart1 that we created in Solution Explorer and make sure that the item is expanded. You can see that the SPI looks just like a folder and contains several items.
Notice that the first file is the “elements.xml” file, which contains the elements manifest for the SharePoint Item. Our SPI was automatically added to Feature1 for us. This will deploy the artifacts in our SPI when this feature is installed and/or activated to the farm. We could have chosen to include it in a different feature or a pre-existing feature by adding it from that feature’s Feature Designer page.
Related Search Term(s):
Share this link:
This site's content Copyright © 1999 - 2013 by BZ Media LLC, All rights reserved.
Legal and Privacy
Phone: +1 (631) 421-4158 • E-mail: