A Django site.
September 2, 2008
» Live On .NET Rocks...

.NET Rocks The other week Brian Randall and I sat down with Carl and Richard to record a .Net Rocks episode.  Honestly, you wait years for a Brian Randall podcast and then three come along at once!

In this episode we talked about what's been happening in the Team System world since 2005, share some best practice war stories and look forward to some the new goodies coming up in the next release.  You can get the episode here.

Don't forget that if you like listening to podcasts about Team System and Team Foundation Server, then hopefully you'll love Radio TFS :-)

April 21, 2008
» TFS Build API by Example #1: Queue a build.

Team Foundation Build API Class Diagram - larger version. As we all know by now - the build system in TFS2008 was substantially improved.  Along with the many improvements came an official API for talking to the build system.  This is the same API that the Team Foundation Build UI in Visual Studio uses, however there are many additional methods that were added that were not for the UI at all but for potential consumers of the Build API.

In talking with folks at community events, and on the MSDN forums I have realized that there isn't a huge awareness of this API.  Having written a parallel implementation of the build API, but in Java for the Teamprise 3.0 release I have spent a great deal of time with the .NET API and have a few examples lying around of how to accomplish certain common tasks - so I thought I would run through a some of them.  If you have an example of something you would like to see with the build API then please leave a comment for this post or drop me a line.

So - let's start with a basic one.  How to queue a build.  This will introduce us to a few concepts with-in the build API that are common across all of the methods.

The Easy Way.

A quick look at the class diagram above will show you that the main interfaces you'll be dealing with in the Build API are the IBuildServer and IBuildDefinition interfaces.  To get started with these you'll need to add references to the Microsoft.TeamFoundation.dll, Microsoft.TeamFoundation.Client.dll and Microsoft.TeamFoundation.Build.Client.dll.

C#

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http://tfsserver:8080”);
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
IBuildDefinition buildDef = buildServer.GetBuildDefinition("TeamProject", "Build Name");
buildServer.QueueBuild(buildDef);

VB.NET

Dim tfs As TeamFoundationServer = TeamFoundationServerFactory.GetServer("http://tfsserver:8080")
Dim buildServer As IBuildServer = DirectCast(tfs.GetService(GetType(IBuildServer)), IBuildServer)
Dim buildDef As IBuildDefinition = buildServer.GetBuildDefinition("TeamProject", “Build Name")
buildServer.QueueBuild(buildDef)

I'm afraid that's the last example you'll be seeing in VB.NET.  Being a Java developer by day I tend to like my semi-colons.  However if you are a VB developer then hopefully you'll be able to follow along as the rest of the examples are more or less just method calls with the occasional bit of casting.

So - what's going on here.  Well we first get hold of a TeamFoundationServer object.  If this was server side code and we wanted to specify some credentials then we would use a slightly difference mechanism but in this case the constructor works well and this will automatically connect using the credentials of the current thread.

Next we get hold of the build service that implements the IBuildServer interface.  Finally we get a hold of the build definition by specifying a team project and build definition name (build definitions are unique per team project in TFS).  We then queue a build using the defaults for that build definition.  This API call is actually shorthand for the following...

The Hard Way

IBuildRequest interface diagram Supposed you want to queue a build, but you don't want to use the default build agent, priority, drop location etc.  Well in that case you need to look at the IBuildRequest interface.  Here you will find all the options to customize the build request, you can specify a build agent, drop location, priority etc like you can do from the Visual Studio UI.  You will also find other options such as being able to queue the build with a maximum acceptable queue position, pass a custom get version for the build or even queue the build in a postponed status.

In the following example, I am going to find a non-default build agent from the server and then queue a build using it.

        TeamFoundationServer tfs = new TeamFoundationServer("http://tfsserver:8080");
        IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));

String teamProject = "TeamProject";
String buildDefinitionName = "MyBuildDefinition";
String buildAgentName = "MyBuildAgent";

// Find our (non default) build agent.
IBuildAgentQueryResult queryResult = buildServer.QueryBuildAgents(buildServer.CreateBuildAgentSpec(teamProject, buildAgentName));
if (queryResult.Failures.Length > 0 || queryResult.Agents.Length != 1)
{
throw new Exception("Invalid Build Agent");
}
IBuildAgent buildAgent = queryResult.Agents[0];

IBuildDefinition buildDefinition = buildServer.GetBuildDefinition(teamProject,buildDefinitionName);

// Create a build request based on our chosen definition.
IBuildRequest buildRequest = buildDefinition.CreateBuildRequest();
// Optionally set command line args, drop location, priority, custom source version etc here
// in this case just overriding default build agent.
buildRequest.BuildAgent = buildAgent;

buildServer.QueueBuild(buildRequest);


Pretty simple really and very powerful.  I encourage you to go take a look at the IBuildServer interface to see some of the stuff that you can do.  If you have any suggestions as to what you would like to see as a build API example then leave a comment to this post.

March 13, 2008
» CodePlex Project Stats

The fantastic team at CodePlex have just rolled out yet another great feature - this time it is statistics for your CodePlex project.  I dropped by my TFS Plug-in for CruiseControl.NET to take a look...

codeplex_stats 

The project is currently averaging over 12 downloads a day and has had nearly 5000 downloads since I moved it to CodePlex in August 2006.  Not bad for a chunk of code I originally wrote on a plane..

This is incredibly motivating as a maintainer of an Open Source project.  I've been knowing that I need to give the CC.NET integration some love as there are a few issues and things that I need to address from the excellent feedback I have been receiving.  However - seeing how many people are still interested in the plug-in despite the excellent CI functionality in the 2008 release of TFS has made me realise that I need to get on this ASAP.  Thanks CodePlex!

February 21, 2008
» DDD is coming to Ireland

DDDLogo Developer Developer Developer is coming to the beautiful west of Ireland in May with GAMTUG hosting the event on Saturday May 3rd.  If you are in or around Ireland at that time then I would encourage you sign up.  My good friend, and fellow Team System MVP, Mike Azocar will be doing a session on Scrum which should be well worth sitting in on.

There will be no Microsoft speakers presenting, just speakers from the .NET developer community, although I hear our local friendly Platform Evangelists (DPEs) will be on hand to help out and chat to everyone and to take in the atmosphere.

The day promises to be a great learning experience, but also a fantastic way to meet like-minded people - if anything else, you get a trip to the lovely Galway which is never a wasted journey.

October 6, 2007
» ASP.NET MVC Framework

Some interesting news seems to be coming out of the Alt.NET Conference in Austin.  I'd got a few IM's from folks at the conference talking about Scott Guthrie's talk. According to Jeff Palermo's blog, Scott Guthrie showed off a new ASP.NET MVC Framework.  This looks very interesting and might well tempt me back into ASP.NET development.  I really like parts of ASP.NET but that whole postback / viewstate thing just confused me.  I was used to doing web applications the hard way and having this abstracted away from me into a semi-winform like representation of a web page just got in my way when building sites.  It also made them pretty hard to unit test.

Having used (and even written) a few MVC frameworks in the past, I'm really interested to see what it is all about.  Looking forward for some more information soon.  Jeff's post has a few tantilising details which make me thing this is exactly what I want from ASP.NET.

September 28, 2007
» Windows Server 2008 RC0

Windows Server 2008 RC0 of Windows Server 2008 was made available earlier this week.  I am currently installing it inside a Virtual PC and I have to say I'm impressed so far.  The installation process is much faster and smoother.  Also, it is very strange to see how far the "secure as default" mantra of Microsoft has come over the past few years.  In Window Server 2008 when you first install even the Sound Service is disabled and you have to enable it before sounds will come out of your soundcard (this is made easy by some nice UI from the standard volume control).  How times have changed... 

BTW, when installing Windows Server 2008 inside Microsoft Virtual PC 2007 I said that it should use the Windows Vista soundcard when creating the initial VPC configuration and it seems to work great.

August 8, 2007
» I Love Resharper

As I've mentioned before, I love Resharper from those crazily clever folks at JetBrains.  Today I installed an Early Access version of 3.0.2 into Visual Studio 2008 and all the goodness has returned.  No need to write a Using statement again, error highlighting in C# without needing a build, the good old Ctrl-Shift-N keyboard shortcut among others.  The 3.0.2 release has come a long way since the 2.5 release that I had been previously using, there are increased coding best practises and some nicer inline static anaylsis.  The plug-in is also much more friendly in how it takes over any Visual Studio shortcuts and means that I don't have to re-train the old muscle memory when switching between keyboard shortcuts for actions in Eclipse and Visual Studio.

If you are spending all your day in Visual Studio then I urge you to take a look at Resharper.  Personally, I find the increase in productivity well worth it, not to mention the increase in code quality that you get as a result.

May 19, 2007
» IMTC Registration Open!

If the recent announcements about Silverlight have your interest and you can get to Dublin on June 7th this year then I would urge you to take a look at this years Irish community conference IMTC.  It used to be called INDC but they had to drop the "D" because there is sooo much more to the event than just developer stuff.

Folks who went to the event last year will remember the highlight of the event were the talks and hand-on sessions with Scott Guthrie.  This year, I suspect the highlight will be the Silverlight sessions from Tim Sneath - group manager for Silverlight and WPF.

These conferences are ran by the combined Microsoft Techology user groups of Ireland and are a great opportunity to catch up on what it going on, have great talks from world class presenters and chat with your fellow techies - which is always the best bit.  The conferences are always very personal.  The event is being organised by the community for the community, but they have managed to attract some generous sponsors which means they have managed to keep the costs down to only €50 per person.

If you can make it to Dublin I would strongly encourage you to go.  You'd be hard pressed to get such great content in one place along with the chance to interact with the presenters.

When: June 7th, 9am till late (It's an Irish event after all...)
Where: Cineworld complex , Dublin
Cost: 50 euros (to help cover costs).
Website: http://imtc.firstport.ie/

With 18 sessions from amazing speakers, this is one event that you will not want to miss. They are covering everything from the new Silverlight and Expression products (very exciting!) to WCF, Biztalk, SQL Server, Longhorn Server, Security, Mobile technologies, Card Space and even Game Development with the XNA framework with some robotics thrown in as well.

Book now before it is sold out.

January 22, 2007
» Getting excited about the next Orcas CTP

I'm getting really excited about the next CTP for the next release of Visual Studio (Codenamed Orcas).  Not only will previews of some great new features in Team Foundation Server be coming along, Scott Guthrie just announced a bunch of changes to the web designer editor in Visual Studio.  Reading Scotts post it looks like the Visual Studio editor has now got nearly all the features you would want, including ones I was used to from static page and JSP development using Dreamweaver.  Orcas is shaping up to be a very exciting release!

December 15, 2006
» Jamie Cansdale's Dev Tools Charity Auction

Jamie Cansdale (the brains behind the must-have Visual Studio Extension TestDriven.NET) has set up a charity auction in aid of the charity Wells for Zoë and its work in Malawi.  What's better is that he's convinced many of the other must-have .Net development tools folks to donate some licenses into the pot as well.  There is now nearly $45,000 worth of software up for grabs - yes you read me right, that is three zeros on the end of the 45.  Now I know the US exchange rate is not as good as it used to be, but still - you could end getting yourself software to the value of a decent car and know that you are giving some money to charity.  For me the highlights of the auction are:-

  • A TestDriven.NET Mug (along with an invite to a years MSDN Subscription worth over $10k)
  • A copy of the excellent source control tool, Vault.
  • A copy of the mouth-watering CodeRush with Refactor! Pro 

Wells for Zoë is an Irish registered Charity set up in 2005 dedicated to the provision of safe drinking water and water storage for irrigation in four remote rural areas of Malawi.  The charity's founders cover all administrative overheads. 100% of your donation will be used to help the people in Malawi.

What are you doing still reading this - go and bid now.  In case you don't feel like owning some of this awesome software you can also donate here.

November 17, 2006
» Windows Vista Available to MSDN Subscribers

I logged into my MSDN subscription account this morning to find the following additions in my Operating Systems section!  Obviously, the first thing I did was to start the download of the (single) DVD image for all 32-bit versions of Windows Vista.  I tired to request my product key for Windows Vista Ultimate Edition, however there was an error in the MSDN Application - I guess that they are still getting those set up.  Anyway, the current estimate is that my download will finish in 20 hours 10 minutes (and that's while the US is asleep), so I'm guessing the keys will be available by the time I finish downloading.

Update:  It's 2pm now and my download got to 16% complete before it was interrupted.  Now I cannot get a connection at all probably because everyone else in the world is trying to download it.  I think I'd better wait until the weekend...

Update:  It's now 6pm and my download speed has picked up to 246Kbs (the maximum for my ADSL link), also the product key section of MSDN is now working and I am the proud owner of a Windows Vista Ultimate Edition key!!  Hmm, I wonder what I'm going to be doing this weekend :-)

October 31, 2006
» TestDriven.NET 2.0 now shipping

In case you missed the excellent news, Jamie Cansdale has announced that TestDriven.NET 2.0 is now shipping.  The TestDriven plug-in is essential for anyone wanting to run unit tests from with Visual Studio (any edition).  Not only does it allow you to run any flavor of test from the comfort of your right mouse button - it is also lightening fast (much faster than the built in test runner than comes with Visual Studio Team System).

Along side the ability to run all common unit testing frameworks from any version of Visual Studio, Version 2.0 brings many new "power" features that are just fantastic for those of us that spend a lot of time creating plug-ins to Visual Studio.

Jamie is committed to keeping TestDriven.NET available for the community so that the power of unit testing is available to all (not just those of us lucky enough to work for organizations who can provide the upfront investment required for Team System).  A fully functional, no nag, version of TestDriven.NET is available if you want - however if you are using this professionally, then I urge you to sign up for a professional or enterprise license.

If you are not unit testing today, then you really have no excuse to go out, download your test framework of choice, install TestDriven.NET and get started.  Not only will your tests all be available should you make the wise decision to upgrade to Team System, if you use one of the popular testing frameworks such as NUnit then there is a convertor available to turn them into the MSTest framework used by Team System - meaning that your testing investment is protected for the foreseeable future at least.

September 2, 2006
» .NET Framework 3.0 RC1 Released

I've been involved with Indigo for exactly 2 years this week, through the various changes in product name.  Anyway RC1 of .NET 3.0 was released yesterday (just under a year since .NET 2.0).  I'm currently downloading it and will install over my beta version of WinFX.  I'm quite interested to find out if the .NET Framework assemblies get revved at all or if the framework has the same v2.0.50727 libraries that were released with .NET 2.0 last year + the WinFX stuff.  I'll soon find out...

Update: Looks like it is .NET 2.0 + WCF, WWF and WPF (which I'm very glad about to be honest).  Right then, off to have a play with my TFS Proxy Sync service (which uses WCF to listen to check-in notifications from the Team Foundation Server...)