Thursday, May 8, 2008

The CreateObject of '(null)' caused exception C0000005.

I had to upgrade an old-school ASP website the other day. I uploaded the new version of the .asp pages, unregistered the website .dll file, made a backup copy of it, copied the new .dll over, and then registered it. Everything when to plan (so I thought) until it was time to test the site. I then received the following error:

The CreateObject of '(null)' caused exception C0000005.

I thought to myself - how could this happen? I've tested the .dll file on a test site and had no problem with it. So I immediately when to the source code and had a look at the line where it was giving the error. Funny that, the line giving the error was not modified by me! In fact the page was not modified at all.

So I decided to restore the original version of the .dll (good thing I did make a backup), and it too gave me the same error. Very strange.

The only thing left to do was an IIS restart. And that fixed the problem.

So the problem was probably due to IIS still having a reference to the old version of the .dll, and restarting IIS was a way of flushing it out.

No comments: