What is a solution package and how to create a solution using visual studio 2010?

This SharePoint 2010 tutorial explains, what is a solution package in SharePoint? And how to create a solution using visual studio 2010?

What is a solution package in SharePoint 2010?

This is nothing but popular the .wsp file in SharePoint 2010.

A solution package is a CAB file with a .wsp file name extension and a manifest file. You can create this manually by using a tool known as Makecab.exe.

But in SharePoint 2010 while developing a solution using Visual Studio 2010 it is very easy to create the .wsp file. Whenever you will build the project, if the build succeeded then the .wsp file will be created inside the bin\Debug folder.

A solution package is a distribution package that delivers your custom SharePoint Server 2010 development work to the Web servers or the application servers in your server farm. Use solutions to package and deploy custom Features, site definitions, site templates, layout pages, Web Parts, cascading style sheets, and assemblies.

Below are the components that can be packaged in a solution file:

  • .NET Framework assemblies, typically Web part assemblies and event receiver assemblies.
  • Deployment files such as resource files, pages, images or other helper files.
  • Features, which allow you to activate and deactivate code in a Web site and provide functionality that includes elements such as custom lists, libraries, fields, and content types.
  • New templates and site definitions etc.

You can use solution packages to deploy new solutions and upgrade existing solutions across the farm. You can package all your SharePoint Server entities as one file, add the file to the solution store, and deploy it to the front-end Web servers in the farm.

In SharePoint 2010, a user also can save a customized site as a template, which is a .wsp file and that can be deployed on another farm.

Deployment of Solution package

You can deploy the solution package using PowerShell in SharePoint 2010.

Before Deploying the solution to the farm, we need to add the solution to the farm like below:

Add the solution to the farm:

Add-SPSolution -LiteralPath

Example:

Add-SPSolution C:\MySolution.wsp

Install the SharePoint solution to the farm:

Install-SPSolution -Identity  -WebApplication

Example:

Install-SPSolution –Identity MySolution.wsp –WebApplication http://URLOfWebApplication -GACDeployment

Create SharePoint Solution using Visual Studio

Now, we will see how to create a solution using visual studio 2010 in SharePoint 2010.

The SharePoint projects in Visual Studio require administrator privileges to interact with SharePoint.

Step-1:
To launch Visual Studio as an administrator, Go to the Microsoft Visual Studio 2010 shortcut in the Start Menu under All Programs > Microsoft Visual Studio 2010.

Step-2:
Right-click on the Microsoft Visual Studio 2010 shortcut. You can choose Run as administrator from the context menu to run Visual Studio as an administrator.

Another way if you want to run always the visual studio as administrator then you can change the Microsoft Visual Studio 2010 shortcut properties to always run as administrator.

To do this, right-click on the Microsoft Visual Studio 2010 shortcut and choose Properties. Click the Compatibility tab. Then check the Run this program as an administrator checkbox and press OK.

Step-3:
Once Visual Studio has started up, choose New > Project from the File menu. This brings up the New Project dialog. Select Visual C# as the language from the tree view control on the left. Then expand the Visual C# node and select SharePoint under the Visual C# node.

Expand the SharePoint node and click the 2010 node. This will display all the available SharePoint project types.

Visual Studio has 12 basic SharePoint project types. These are below:

Choose the project type as per your requirement.

You may like following SharePoint 2010 tutorials:

This SharePoint tutorial, we learned what is a solution package in SharePoint 2010? And how to create a solution in SharePoint 2010 using visual studio 2010.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

>