Navigation

Friday, 9 October 2009

Visual Studio 2010 - Automatic creation of SharePoint WSPs for deployment (joy!)

It's long been a challenge to generate WSP packages effectively.
 
Back in the old days we would manually hand-crank out DDF files and manifest.xml and use makecab utilities to generate them. There was the most short-lived of joy when everyone rushed to download VSeWSS (Visual Studio extensions for Windows SharePoint Services) ... and then made an equally mad rush to un-install it when they realised how bad it was! Finally most people settled on 3rd party tools like WSP Builder, but even then quietly grumbled about it's limitations and bugs.
 
Well .. the time is here to rejoice once more .. Visual Studio 2010 to the rescue! (queue golden lights, music and champagne).
 
So what does Visual Studio 2010 bring to the table then?
 
Well, the most interesting thing to note is that VS10 (Visual Studio 2010) has baked-in support for SharePoint 2010. This includes a whole raft of project templates; Web Parts, Site Definitions, Workflows, Business Continuity Services (a.k.a. BDC.. and very interestingly an "import workflow from SharePoint Designer" option!).
 
All of these include baked in WSP support in the form of a new "package" folder in the project structure. This is the bit responsible for turning your Visual Studio solution and re-packaging it up into a WSP (no 3rd party tools, no code, no complicated build scripts!)
 
The really cool bit is in the deploy / undeploy options:
  • Create WSP file
  • Reset IIS app pools
  • Add / Retract solution from SharePoint
  • Activate features
  • Run Pre/Post build commands
  • <Custom Actions>
This allows you to customise these actions (so that they execute in any order you like!) and the ability to add your own Custom Actions makes this VERY exciting!
 
You can also modify the manifest.xml template that it uses (adding your own custom markup if you want!) and specify any external assemblies that should be included, even specifying if those other assemblies should be GAC or bin deployed!
 
Finally, the last one of note is the ability to import an existing WSP and convert it to a Visual Studio Project. The implications for this are massive! Any older projects or 3rd party WSPs can now be migrated over to the new VS10 structure. Of course custom code will not be migrated in, but it is a cracking effort and goes a long way to making this more manageable (especially for "code free" CAML based features!!)
 
All of the above is covered in the online free sneak-peek sessions, so if you haven't already, go watch the SharePoint 2010 Sneak Peek video for Developers now!


No comments:

Post a Comment

This blog has been moved to www.martinhatch.com

Note: only a member of this blog may post a comment.