Friday, 23 September 2011

SP2010 Continuous Integration–pt 4: Assembly versioning

The 4th article in our CI with SharePoint 2010 and TFS series is now live on the official SharePoint Developer blog. This post is a quick overview, but the actual article can be found here - Configuring Versioning of Assemblies in SharePoint Automated Build. In this episode we cover how to introduce assembly versioning to your automated build process. The benefits of versioning code are widely documented, but in my simple mind I think of it like this – if you don’t have versioned assemblies, how can you easily tell which version of code is running in a given environment/customer/product? The answer is you can’t – at least, not without resorting to Reflector or some other decompilation tool and literally scanning code. And that’s really not efficient nor effective – far better to put something in place once, and forever be able to determine the version by looking at the file in Windows Explorer. I’d argue that most pure .Net development shops tend to have adopted assembly versioning a long time ago, but again it’s one of those things which is somewhat behind in the SharePoint world due to the other complexities which come with it.

Additionally, versioning in SharePoint can be a very bad idea if not done appropriately (no doubt a few people tried and got bitten by this). Version numbers are stored in many places inside SharePoint, and using typical versioning approaches will result in a broken application. Instead, I always recommend that a secondary version number such as AssemblyFileVersion is incremented with SharePoint.

So if we’re agreed that it’s worthwhile, how do we adopt it? It would be nice if TFS had some simple switch, but that’s not the case up to and including TFS 2010 (personally I’ve no idea about future versions). Implementing versioning requires some customization of the build process (which we introduced in the last article, Creating your first TFS Build Process for SharePoint projects), and essentially we need to drop in a custom workflow activity which takes care of the versioning step. I’ve written such an activity and published it on Codeplex at (others exist too). The article explains how to implement the sample to perform versioning in the right way.

That link again is Configuring Versioning of Assemblies in SharePoint Automated Build.

The next article will be “Deploying WSPs as part of an automated build”.

Thursday, 15 September 2011

My SharePoint Conference 2011 talks–ribbon development and CI

Unless you’ve been under a rock you’ll know that this year’s big event in the SharePoint world is the official SharePoint Conference 2011, held in Anaheim near Los Angeles. We’re now just over 2 weeks to go, and since many are starting to build their conference schedule I thought I’d mention my talks. I’m presenting 2 sessions and, somewhat weirdly, both of them are co-presents with other speakers. I was looking forward to speaking already, but this aspect makes me even more excited – both my co-speakers rock and I think these are gonna be fun sessions!

Both talks are on the Wednesday – one in the morning, one in the afternoon:

Application Lifecycle Management : Automated builds and testing for SharePoint projects – SPC319, Weds 10:30am
With Mike Morton, Visual Studio Senior Program Manager (Microsoft)

Whether small or large, experienced or novice, any SharePoint development team can improve their process! This demo-heavy session will show you how Visual Studio Ultimate and Team Foundation Server can be used to automatically build your SharePoint solutions, deploy the resulting WSP’s to a remote SharePoint environment, and leverage automated Visual Studio UI testing (which can have a lower barrier to entry than unit testing) to help you find issues faster. Come hear some great, real world information that will help you create higher quality code; as a bonus you will get to admire Chris’ good looks and enjoy Mike’s crazy humour!

Deep Dive on SharePoint Ribbon Development & ExtensibilitySPC402, Weds 5pm
With Andrew Connell (MVP, Critical Path Training) 

Take advantage of the Ribbon in your SharePoint applications for a tightly integrated and great user experience! Developers can customize and extend the ribbon for custom solutions. In this session we'll examine the different components of the ribbon as well as how to create page components, asynchronous callbacks and prompt the user with intuitive dialogs. Best of all you can do all this from the sandbox and avoid getting admins involved in deploying farm solutions!

Hopefully see you there!