Posts Tagged ‘WSP Builder’

WSPBuilder Best Practice

- Create a Deployment Project under you solution structure called deployment
- Place all the xml ,xslt ,css and aspx in the right structure under the 12 folder in the deployment project
- Create Projects for code behinds , business or data layers to generate only dlls
- Add this post build events to copy the generated dlls to the GAC folder under your deployment project
cd $(ProjectDir)
Copy "$(TargetPath)" "..\Deployment\GAC"

- Add this post build events to the deployment project to generate the WSP Package and place it under the Deployment project directory
cd $(ProjectDir)
"C:\Program Files\WSPTools\WSPBuilderExtensions\WSPBuilder.exe" -WSPName $(ProjectName).wsp
This parameter “-WSPName $(ProjectName).wsp”
generate a WSP Package with the name of the Deployment Project by default it the name of the project directory.
For more parameters help please run the command
"C:\Program Files\WSPTools\WSPBuilderExtensions\WSPBuilder.exe" –Help

- From the solution properties Set the Deployment project to depend on all other projects
so by this you make sure that whenever you are building the package it will contain the latest dlls because other projects will be building by default and copying the dlls to the GAC Folder
- when first time building the project it will automatically create a text file called “solutionid.txt” under the deployment project directory , that file will contain the id of the generated wsp package, it is very recommended to include that txt file into your project and check it in into TFS , so you make sure that all the team members will have the same WSP package id .

Disadvantages
- WSP Builder Includes any file included in the “File” structure of the deployment project and not the “project” structure, so any files that is hidden or not included in the deployment project structure, however placed in the physical structure of the files will still be included ,
So before each build you have to clean up your file structure from any unwanted hidden files.

- The commands lines copying the dlls to the GAC folder will also copy the external referenced dlls that is having the property “Copy Local” to true , and that will end you up deploying dlls that you don’t want to deploy or even deploying dlls that is already included by other packages which is totally not recommended.
So please make sure that any dll reference has the property “Copy local” is set to false.

- sometimes to use the WSPBuilder it is needed to create empty Folders Like "GAC" and empty folders are not physically created in the TFS , and that causes some problems when Using MSBuild tasks to Do a release on the Build Server

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
 

STSADM From Your Visual Studio

This Trick Allan showed me…

You can add a menu tool to your visual studio to add/upgrade/delete your WSP solution If it located in the same folder for your VS Project

Open your Visual Studio Select Tools > External Tools then Click ADD

Tool 1 :"Add WSP" this tool Adds Your WSP solution to the Share Point Solutions List … How Ever It Adds it Without Deployment So you need to Open Administration site for share point and open Central Administration > Operations > Solution Management to deploy the project after using this tool

back to what we were saying

image

Too1:

Write the following

Title : Add WSP

Command : system Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE

Arguments : -o addsolution -filename $(TargetName).wsp

Initial Directory : $(ProjectDir)

Check Use Out Put window Option

Tool2: UpGrade WSP (Only Works When Your Solution is Deployed Already on share Point Used Up Grade the WSP Solution)

Title : UpGrade WSP

Command :system Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE

Arguments : -o upgradesolution -filename $(TargetName).wsp -name $(TargetName).wsp  -immediate -allowgacdeployment

Initial Directory :  $(ProjectDir)

Check Use Out Put window

Tool3:(Removes the WSP Solution From the share point Solutions how ever the solution must be retracted before using this tool, to retract your solution open Administration site for share point and open Central Administration > Operations > Solution Management )

Title : Remove WSP

Command : system Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE

Arguments : -o deletesolution -name $(TargetName).wsp

Initial Directory : $(ProjectDir)

Check Use Out Put window

To Make any of These Tools Work You must First Select the Project in the Solution Explorer window In the VS before selecting the tool from the tools menu … Also the WSP solution must be in your project Directory.

To Generate the WSP solution from Your VS you can see the tool I mentioned in my Previous Post

I made tool for the WSPBuilder From my Previous Post to generate the Wsp in the project folder

Tool4:(generate Wsp file from VS project in the project`s folder)

Title : WSP Build

Command : WSPBuilder Tool Path\WSPBuilder.exe

Arguments :

Initial Directory : $(ProjectDir)

Check Use Out Put window

 

So you can develop your project use tool4 to generate the wsp solution use too1 to add it to the share point solutions ,deploy it from the administration site and if you made some modifications to the project you simply rebuild it and then use tool 4 and finally use tool 2.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
 

FROM VS Solution TO WSP Solution

There is a Tool That Automatically creates SharePoint Solutions files based on a folder structure. WSPBuilder will automatically traverse a "12" folder structure
and creates a SharePoint solution manifest.xml and the wsp file based on the files it finds.

Lets say that you have created a SharePoint feature and you want to create a SharePoint Solution
for this feature. Then you just need to create the following folder structure in you project directory:

"[MyProject]\12\Template\Features\MyCustomFeature\"

and put your feature files in the MyCustomFeature folder, that being your feature. Then run the WSPBuilder from the your project directory and it will automatically create the manifest.xml and pack it into a wsp file with the content of the "\12" folder.

To get the latest version of WSPBuilder Visit All Releases

For more Information About WSPBuilder and how to use it Visit the Orgional Topic

More Over you don’t have to paste the WSPBuilder.exe in your project directory … you can read my previous post and you will know the way to do that ;) My Previous Post

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
 

 

View Abdel-Rahman Awad's profile on LinkedIn

Archives

 

Rss Feed Tweeter button Facebook button Linkedin button Delicious button Digg button