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)

 

View Abdel-Rahman Awad's profile on LinkedIn

Archives

 

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