Archive for November 7, 2008

Solution Development with SharePoint Extensions Part 1: Planning Your Features

The WSS Extensions for Visual Studio 2008 1.2 are terrific – a big improvement over the tools provided in VS2005 – for a number of reasons. One of these is the WSP View tool.

The first time you create a SharePoint solution with the extensions, you will notice that the files which are needed to deploy are generated for you by the extensions when you click “Deploy”. No more handwritten solution manifest files (yes, I admit, I have done this – I even created a DDF file for makecab.exe to use in order to create my .WSP files. Not fun.) This is great, but the tools cannot infer the arrangement of SharePoint assets into features. Instead, it simply assumes that each asset is its own Feature. Therefore, if you create 10 Web Parts for your solution, the extensions will, by default, create 10 features for you and deploy them to your development server.

OK, not a big deal at development time, but when we are ready to start thinking about deploying the code to an Integration Server, we will want to consolidate a bit. Ideally, we should have control over how the features are packaged without having to hand-write the changes which come out of our build server.

WSP View is a solution manifest viewer which works inside Visual Studio to do just this. You can drag and drop your feature elements from feature to feature, until you have a set of features which have manageable dependencies.

 110708_2156_SolutionDev1

In the example above, I created a List Definition named “Tracking Report Card”. The List Definition has several Views which are represented as ASPX files. I then created an Event Handler for the List Definition so that I can respond to events within the list. When I created this, Visual Studio created 3 features. Since the List Definition, List and Item Event Receivers are all inter-dependent. It makes sense to package them as a single feature with multiple elements.

WSP View makes this much easier than having to hand-change the feature definition files – too many GUIDs!

Brian Berry is a Director of Technology Consulting with BlumShapiro, focusing on Microsoft Business Intelligence solutions, with a strong focus on Systems Integration, Master Data Management and PerformancePoint Services.  He has been helping companies optimize their investments in Microsoft technology for over 12 years.