Wednesday, February 11, 2015

How to Create SharePoint package (.wsp) as part of the build process in Visual Studio 2012 /2013

Some of you have faced or may have noticed an issue when you create a SharePoint project in visual studio 2012 or 2013 you don't get a option called package like we had in VS 2010.

IN VS 2012 / 2013 we don't have this Package option. so what happen is that when you build a project it only create or update the DLL no WSP creation. WSP create only if you deploy the application through the Visual studio itself 




In VS 2012 or 2013 build commands are not embedded into the project file. so we need to add them manually if we need to create both dll and wsp in the build process.  

there is two way to edit VS project file

1) Unload the SharePoint project from the solution and right click on project then select Edit. The project will open in an editor.

2) Go-to the project location then you will find the CSPROJ File (.csproj) file. then you can edit even using Notepad.



Then add following tag into the following location.

<PropertyGroup>
    <BuildDependsOn>$(BuildDependsOn);CreatePackage</BuildDependsOn>
</PropertyGroup>



you will be asked to Reload the project after this file been saved. now when you build the project dll and wsp file will be created.

ok That's It ... 
HAPPY CODING