I have just finished writing a program for a client. Perhaps finished is too strong a word – the client hasn’t tried it out yet, and who knows what they will find.

But I have produced what I believe we agreed upon, and I think there will only be minor glitches to fix up. Unfortunately, over the past few weeks I have gone through period of major computer breakdowns. First my development PC had a hard disk crash followed by other problems. It has now been replaced.

Soon after my wife’s PC, which I use to test things on, packed up. So it meant that I wasn’t able to test the application on a clean PC. Mine is no good for testing because it has the programming environment installed, in this Visual Studio .NET.

What was I to do? I had promised the client the week before that I would be there on Friday. I had thought that I would have the PC back by then and all would be well. Unfortunately, the computer had some more serious problems than we anticipated and I didn’t get it back until today.

Well, I did what any self-respecting developer would do. I assumed that the program was perfect and took it out to the client. Guess what? Yeah, you got it in one. I knew that some of the application was working because the first thing it does is look for a database. And it did that.

The database connection string is held in an app.config XML file. And the database itself was installed on a server. The application came up with a message telling me that I needed to connect to a database and opened a file dialog so I could find and connect to the database. So far so good. That meant that the application had started up. It also meant that the .NET framework had installed properly, otherwise it wouldn’t have read the app.config file. But when I seleceted the database I got an error.

This client is a good guy. He knew that I had had computer problems and I told him that as soon as I got the testing machine back I would check it out and then get back to him. But I still felt, and looked, like an idiot.

On the way home from the client it occurred to me that one of the dll files may not have been installed. And I happened to have a copy of that dll on a CD. I almost turned around and went back. But caution got the better of me and I continued home to check it out.
Sure enough, when I got home and checked I realised that I had not installed this dll. I rang the client and told him the good news but we decided to wait until I got the test machine just to make sure.

Today the PC arrived back. A completely clean PC with nothing but Windows on it. I installed the .NET framework and then my application, without the missing dll, and got the same error. Good. I then installed the dll and sat back in triumph waiting for my application to load in all its glory. It didn’t. It still wasn’t working.

Now this was a fairly simple application so I didn’t build an setup file, or go through any of the normal deployment stuff. One of the good things about .NET is that you can copy everything straight to the correct folders and everything should work. Provided you copy everything.

I had obviously missed something. So I added a setup project to the assembly and looked at the dependencies. There were two more dlls that I had missed. How stupid was that!
If I had built the installer files in the first place I would have found the problem, and I probably should have done that. And it was my intention that, after the client had looked at the program and I made any changes that he suggested then I would build him an installer.

But if I had been able to test everything then I would have found out straight away that there was a problem.

Moral – always, always, test.