This past weekend I spent way too much time with Jon while trying to get our new work machines setup. Normally most of the time is spent waiting for Visual Studio to install (seriously that thing takes forever), but not so this time. DB2 kept refusing to work and play well with others. Specifically the driver that .NET uses to communicate with, and thus began several hours of googling and downloading and installing.
Before installing anything more than just Visual Studio 2005 (and doing a build of course), I tried to login and got:
Could not load file or assembly 'IBM.Data.DB2, Version=22.214.171.124, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies. The system cannot find the file specified.
This wasn’t surprising as I had not yet installed any DB2 drivers.
So then I went and installed what I thought was the correct bit (ibm_data_server_client_win32_V97.zip) and got:
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.7.0
After scouring the internet, I found a post informing me that on 64 bit machines, the install will falsely report it completed successfully and fails to update the machine.config. To resolve it advised adding the following:
<add name=”IBM DB2 .NET Data Provider” invariant=”IBM.Data.DB2″ description=”IBM DB2 Data Provider for .NET Framework 2.0″ type=”IBM.Data.DB2.DB2Factory, IBM.Data.DB2, Version=126.96.36.199, Culture=neutral, PublicKeyToken=7c307b91aa13d208″ />
<add name=”IBM Informix .NET Data Provider” invariant=”IBM.Data.Informix” description=”IBM Informix Data Provider for .NET Framework 2.0″ type=”IBM.Data.Informix.IfxFactory, IBM.Data.Informix, Version=188.8.131.52, Culture=neutral, PublicKeyToken=7c307b91aa13d208″ />
<add name=”IBM DB2 .NET Data Provider 9.7.2″ invariant=”IBM.Data.DB184.108.40.206″ description=”IBM DB2 Data Provider 9.7.2 for .NET Framework 2.0″ type=”IBM.Data.DB2.DB2Factory, IBM.Data.DB220.127.116.11, Version=18.104.22.168, Culture=neutral, PublicKeyToken=7c307b91aa13d208″ />
<add name=”IBM Informix .NET Data Provider 9.7.2″ invariant=”IBM.Data.Informix.9.7.2″ description=”IBM Informix Data Provider 9.7.2 for .NET Framework 2.0″ type=”IBM.Data.Informix.IfxFactory, IBM.Data.Informix.9.7.2, Version=22.214.171.124, Culture=neutral, PublicKeyToken=7c307b91aa13d208″ />
to my existing file (C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG), since I’m on a 64 bit box, I also added it to the 64 bit version (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG).
Did an iisreset, same error, more hair pulling. I downloaded various other things from IBM’s website all of which promised to hold the key. Eventually, I finally find that what I need is DB2 Express-C (db2exc_972_WIN_x86_64.zip). As soon as that got installed, things worked just peachy, and both machine.configs were properly updated.
Here’s my big complaint: when I went and looked at an existing working dev environment (my desktop), Add/Remove Programs said only “IBM Data Server Client – DB2COPY1″, which is exactly what the other programs I installed said. So each time I spent hours looking for some possible setting that was missing, only to find there was no mythical setting, IBM just couldn’t be bothered to put in different names for their installed products. If the Add/Remove Programs entry had instead included “Express-C”, I could have gotten both machines installed with their dev environments ready to go in under an hour. Fortunately, on the new installs, it appears that there is now an entry for this item, so if I ever manage to forget all this, I will know what I need.