August 2009 Archive

Automatically Adding SVN Revision Numbers to Assemblies

Source code version control is one thing that no developer should ever live without. If you're working on some code that isn't in a version control system, stop what you're doing now and get yourself one!

There's no excuse - there are plenty of free ones available that are simple to install and use. My personal favourite is Subversion (SVN). The particular flavour I use is VisualSVN which has a simple server configuration system and a convenient Visual Studio plugin. If you're really new to version control, you could do a lot worse than to read the SVN book, too.

Exact revision numbers are a vital part of our quality control process. All bug reports are logged against a specific revision of our code. If a customer calls to report a bug we insist on having the exact revision number - 'Version 2.0.285'. Bug reported for 'Version 2' just aren't good enough and won't get logged in our bug list.

continue reading >
28 August

Visual Studio with Roaming Profiles

I have been having a problem with Visual Studio constantly reconfiguring itself on startup. Quite often, when launching the environment, I get this message...

"Microsoft Visual Studio is configuring the environment for first time use. This might take a few minutes."

True to its word, the message hangs around for a while before letting me get on with my work.

continue reading >
27 August

ASP.NET MVC. Like ASP.NET, but without the Voodoo!

Much has been written about Microsoft's new Model-View-Controller (MVC) framework for ASP.NET. The initial reaction of many developers - me included - is that Microsoft are driving us back to the bad old days of 'tag soup'; Server side code sits nestled amongst the HTML just like the traditional ASP pages we were all so glad to move away from.

When you delve a little deeper though, and learn more about the MVC pattern it really starts to make sense. Most of the code you'll write will be in the Controller classes, completely separate from your HTML. Yes, there is a little server side code in the HTML (the View), but if done properly this can really be kept to a minimum.

If you're having similar concerns, I'd urge you to consider how it would have been received if it had been released with the first version of .NET, before the event driven page framework was released. I suspect the answer to this question is that it would have been met with almost immediate and universal approval. It is so far removed from the really bad days of traditional ASP that most of us would have been singing its praises from the highest rooftops.

continue reading >
14 August

Don't give up on the Written Word

I'm always interested to watch how new technologies and media are adopted by the Internet as a whole. The web has quickly progressed from pages of plain text to include support for images, various formats of audio file, video clips and even 3D worlds (remember VRML?).

As the availability of bandwidth has been increasing at an outstanding rate, so has the availability of video on the web. Website providers are practically falling over themselves to pour video content down the throats of their visitors. As I type this post I am catching up on some missed TV programmes courtesy of the BBC iPlayer.

Increasingly, content providers are making the transition to providing video based content in preference to more traditional, text and image based content. One noticeable example is the prevalence of video based tutorials.

continue reading >
6 August

Automatically switching to SSL in ASP.NET

At first, it seems like quite a simple requirement - to automatically transfer a visitor to an SSL connection when they visit a certain area of our site (everything in the 'secure' folder in our case), and to transfer them back to a plain old HTTP connection when they leave.

Our initial implementation of this was a simple HTTP Module. This intercepted incoming HTTP requests for the '/secure/' folder and redirected the user to an HTTPS version of the same page. Conversely, if an HTTPS request comes in for a page which isn't in the '/secure/' folder, a redirect is issued to the HTTP version.

This appeared to work fine for quite a while. But - we started to have some problems with the release of IE8 and recent releases of Firefox. On visiting the site, it would appear that requests for WebResource.axd were still being issued over HTTP rather than HTTPS. This meant that our users started getting warning messages pointing out that some parts of the page were not being delivered securely.

continue reading >
1 August