Chasing Your Tail

This Dyslexic Dog spends more time chasing his tail than he’d like. I imagine other software developers share my frustrations.

For me it’s usually around trying to get dependencies to cooperate. You know – the situation for native code generation known in the Windows world as “.dll hell”.

There’s a delicious irony when you’re trying to leverage libraries, foster “code reuse” and avoid “not invented here syndrome” with the goal of reducing development time, when you instead spend hours, days, or even weeks just trying to get libraries to cooperate!

As I posted here, I recently “upgraded” from Microsoft Visual Studio Express 2008 to VS 2010 for my personal projects. One of the motivating factors for doing so was the desire to use a stable branch of an open-source library with a deep dependency tree on a new project of mine. That open-source library had a precompiled release that had been built with VS 2010. I grappled for some time trying to get the source(s) to compile on 2008, then decided to bite the bullet and shift all my development for this job over to the latest Express offering from Microsoft. Shortly thereafter I discovered that the other open-source library I was using didn’t want to compile on 2010! It wasn’t until days later that I finally had an error-free compile… days of unproductive frustration.

Now I’m not a huge fan of managed code, and all the trade-offs that entails, but anything that reduces dependency issues is certainly welcome.

Recently I’ve been exploring some web development using Silverlight and C#. As a Flash developer I have a fondness for Adobe’s offerings, but the subset of the .NET framework available to Silverlight developers certainly makes it a desirable environment to explore for Rich Internet App development (as opposed to web-game creation). The abundance of buzzwords around Web dev work with Microsoft technologies are absolutely stomach-turning, and little more than “professional obfuscation” as far as I’m concerned, but under the layers of hype are some core techs that are genuinely useful.

In a managed environment with .NET behind it, I’m no longer trawling the web for open-source libraries, and I’m not needing to worry about binary compatibility. Hooray.

Instead my latest tail-chasing bugbear is trying to get SQL Server working properly!

I’m used to using MySQL as a WordPress or Joomla backend. I’ve used Postgres extensively for applications running from C++ and Python, and I’ve always been partial to the simplicity of SQLite for light-weight C++ projects. The tedium with these database backends during development has usually been around writing the queries and converting the results of those queries into useful data in the Object Orientated world of my language of choice.

Consequently, one of the modern hyped-up features of .NET’s latest offerings that actually excites me is the power and expressiveness of LINQ – “Language Integrated Query”. It allows us to chain functions and use lambda expressions on data sources like XML, collections, and of course, databases. Someone realised that the power of database queries wasn’t just useful in the database domain and has made it part of the language. Cool.

The catch is, the preferred database of choice is good ole’ Microsoft SQL Server. So I diligently downloaded the 100s of MB of packages to get SQL Server up and running on my laptop and ran the installer which promptly complained about the absence of Microsoft Powershell. Powershell? Silly me for skipping all the install instructions and assuming that it would work out of the box, or download missing Microsoft components on an as-needed basis. So I fired up Google and after following a few dead-ends found the installer for Powershell. This was starting to feel more and more like trying to get Open-Source dependencies to cooperate again.

After installing PowerShell the SQL Server 2008 Express installer ground to a halt complaining about the fact that I had an incompatible version of Visual Studio… huh? The latest version of Microsoft SQL Server Express being incompatible with the latest version of Microsoft Visual Studio Express? That didn’t sound right.

The installer was reporting the error as a case of having Visual Studio 2008 installed without Service Pack 1.

This was partially true. I had Visual Studio 2008 installed 2010 side-by-side with Visual Studio 2010 because I still had C++ projects with binary dependencies that were built with 2008 and didn’t fancy porting these older apps to 2010 just for kicks.

I had no need or inclination to make use of SQL Server 2008 with my 2008 version of Visual Studio Express, but the installer had no knowledge of my intentions and in order to “protect me from myself” it was preventing me installing it. Presumably the good folk at Microsoft didn’t want folk downloading a product called SQL Server 2008 and having it not work with a product called Visual Studio 2008. Fair enough – that wouldn’t be a good look.

So after many more minutes of digging knowledge base articles I discovered three possible courses of action:

  1. Install Service Pack 1 for Visual Studio 2008 – That’s right, install a service pack for a legacy application in order to allow me to install SQL Server to use with a completely different application(!)
  2. Uninstall Visual Studio 2008 – Leaving me unable to perform maintenance on my VS 2008 C++ projects.
  3. Install only some parts of SQL Server that were compatible with Visual Studio 2008 sans Service Pack 1 – Leaving my SQL Server installation with undisclosed limitations to its functionality

None of these options really appealed to me. The lesser of the three evils was installing Service Pack 1 for MS VS 2008. So resignedly I trawled MSDN for the SP1 download link. It wasn’t a small download. Oh to have a T1 net connection eh?

Before biting the bullet and clicking download file, I fired up VS 2008 and checked the About box. Sure enough it reported that Service Pack 1 was installed! What next?

In truth, I have no idea. As is often the case when I’m frustrated, I gave up, shut down the machine and took a much-needed break.

When I’d summoned the strength to tackle the problem again, I ran the SQL Server installer without complaint. Go figure.

I’d be interested to hear if anyone else has experienced similar frustrations. I wish I could pinpoint the solution that made it all work. Then this post might be of use to someone and not just a rant. But when you’ve spent too much time chasing your tail, ranting can be quite therapeutic.