How to create SharePoint Package


In this article i'm trying to explain how to create SharePoint Package in Visual Studio and how to create UserControls under sharePoint package and How to Create Application pages under sharePoint Package. This article will help you those who are in begining level to Implement SharePoint package.

How to create SharePoint Package:



SharePoint Project is Just like other website project in Visual Studio. It gives predefined templates which are user friendly and allows deploying custom solution to SharePoint Site. You may find templates are commonly used in our modules.

• Application pages
• User Controls
• Web Parts etc.

SharePoint project allows us to create our custom solutions as package, once package is created it can be deployed through Visual Studio or PowerShell Scripts, but you need admin privilege to execute this in both cases.

Steps to follow while implement SharePoint Package:



Step1:



Open New Visual Studio with administration logins and choose New Project, and in left side of the page you just choose Office/SharePoint then chooses SharePoint solution. Then choose SharePoint Empty website and give a name for that.

1

Step-2:


After creating SharePoint project it's asking the solution type by default it is selected as a “Display as a sandboxed solution" you just choose that as “Deploy as a farm solution", then click on finish button.

2

After creating form solution the visual studio solution explorer becomes like below.

3

Step-3:


If you add user control, SharePoint Mapped folder ControlTemplates will be created and folder with your project name will be created inside this.

4

There are no.of folders are listed out in this case you just choose Template folder and then choose Control Templates then click on OK button.

5

Step-4:


If you add application pages the SharePoint Folder Layouts will be created and folder with your project name will be created inside this.

6

Create a folder under Layouts and give a name for that and inside that folder you just try to add Application Pages by right clicking on that folder and then choose “Add New Item" and then choose Application Pages and give a name for that.

7

Step-5:


You cannot view the designer in SharePoint project, and whenever you use user controls it will not resolve the name space automatically in designer.cs file so you need to manually replace all the entries of user control reference so that you will be able to build the project.

8

Create Web Service under Project:


Right Click on project and choose AddServiceReference then choose Advanced option in bottom left corner of the window.

9

Then choose Add Web Reference in bottom left corner of the window.

10

After choosing Add web Reference option a new window will appear to choose the service reference URL and then give a name for that service and choose OK to confirm that service information.

Create USER control under control Templates :



11

After that a new window will appear, it will show 2 options one is Application page information and another one is user control page information. Choose User control page option then give a name for that and click on ok button to create user control.

12

Create Application Pages:


Create a folder under Layouts give a name for that and then right click on that folder and then choose add new item then choose Application page and give a name for that page then click on Ok button for page creating under SharePoint package purpose.

13

• You can also add Webpart in the same project and use other SharePoint Project templates. But remember that all template which yet to deploy in server need to have same deployment scope.
• You can debug the solution using W3Wp process attachment or simply clicking debug button on visual studio but build should be in debug mode.
• Before you deploy solution in Production, package it under Release mode. If you use webpart in solution, feature file will be created and select appropriate scope (Site scope) for deployment.
• Always keep documentation about modification and backup of old package file of your solution in order to avoid hang over in production due to error in new package update.
• If you are using power shell scripts to deploy Solution it must be retracted before installing it.

Conclusion:



I hope this article will help you for those who are try to create SharePoint package. As of my knowledge i share my views how to implement SharePoint package.


Article by naveensanagasetti
I hope you enjoyed to read my article, If you have any queries out of this then please post your comments.

Follow naveensanagasetti or read 139 articles authored by naveensanagasetti

Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: