I started using the SharePoint Visual Studio Project Templates from CodePlex and extended the original solution to:
Using these templates on several of my customer engagements has gotten their development teams into the habit of packaging their SharePoint solution properly for deployment. I have attached the templates and an example using code samples from Inside Microsoft Windows SharePoint Services 3.0.
SharePoint Project Template
The SharePoint Project template mimics the 12 hive folder structure for working with SharePoint artifact files. I used 12 as the root folder because certain SharePoint artifact files may live outside the TEMPLATE folder (eg. Resources).12|--TEMPLATE |--FEATURES |--...|--Resources
I find working with the 12 hive structure far more intuitive than using the Visual Studio 2005 Extensions for Windows SharePoint Services that also does not provide complete control over the generated solution package. I have used my templates to re-package the code samples from Inside Microsoft Windows SharePoint Services 3.0.
The DLLS folder structure is used for deploying the compiled assembly to the Web Application BIN directory or the Global Assembly Cache and defining <SafeControl> and <CodeAccessSecurity> settings in Web.config for the assembly.DLLS|--CodeAccessSecurity|--GAC|--SafeControls
The SharePoint Project template contains a Post-build event command-line to:
Please review Readme First for how to configure the project template.
SharePoint Deployment Template
The SharePoint Deployment template contains 2 scripts to automate generation of the solution manifest (manifest.xml) and solution package (.wsp):
The Scripts folder contains deployment scripts that call the Stsadm command-line tool to deploy, upgrade and retract the solution package. These deployment scripts can be extended to perform additional installation / un-installation tasks required by the solution (e.g. create new site collection using site definition deployed by the solution package).
The SharePoint Deployment template contains a Post-build event command-line to: