What is a solution package and how to create a solution using visual studio 2010?
Check out Best Alternative to InfoPath -> Try Now
This SharePoint 2010 tutorial explains, what is a solution package in SharePoint? And how to create a solution using visual studio 2010?
SharePoint 2016 Tutorial Contents
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:
Install the SharePoint solution to the farm:
Install-SPSolution -Identity -WebApplication
Install-SPSolution –Identity MySolution.wsp –WebApplication http://URLOfWebApplication -GACDeployment
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.
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.
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.
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:
- Empty SharePoint Project
- Visual WebPart
- Sequential Workflow
- State Machine Workflow
- Business Data Connectivity Model
- Event Receiver
- List Definition
- Content Type
- Site Definition
- Import Reusable Workflow
- Import SharePoint Solution Package etc.
Choose the project type as per your requirement.
You may like following SharePoint 2010 tutorials:
- How to Deploy jQuery files to SharePoint using Solution Package in SharePoint 2010/2013/2016
- Deploy SharePoint 2010 solution(.wsp) package using Powershell
- SharePoint Apps or Add-ins Vs Solutions
- Differences Between Sandboxed and Farm Solutions in SharePoint 2013
- Sandboxed solutions in SharePoint 2010
- Add jQuery in a visual web part in SharePoint 2010/2013/2016
- Error occurred in deployment step Recycle IIS Application Pool in SharePoint 2010
- ECMA Client Object Model (SP.js) in SharePoint 2010
- Call jQuery to SharePoint page using a Content Editor web part
- Reference jQuery in SharePoint 2013/2010 master page or in Application Page
- SharePoint 2010 create a new custom master page using SharePoint designer 2010
- How to use the WebProvisioned event in SharePoint 2010?
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.
SharePoint Online FREE Training
JOIN a FREE SharePoint Video Course (3 Part Video Series)