"The handle is invalid" from an ASP.NET app

Some time ago we encountered a really strange problem with ASP.NET. A site that had worked properly under ASP.NET 1.1  suddenly freaked out. .NET 2.0 was installed on the server, but no settings were changed. At approximately this time the site suddenly broke down with a "The handle is invalid" error message. It was none of the usual ASP.NET error messages, it was just that text on a blank page.

Well, this was certainly something new! I'd never before seen an ASP.NET error message without a single HTML tag, just the text. Well, as it turns out, ASP.NET never even got started (there was no aspnetwp.exe for instance, but everything failed before that).

Reinstalling .NET didn't help, nor did the usual aspnet_regiis trickery. A new IIS site demonstrated the same issue. I was pretty stumped after some googling returned only a single useful discussion thread, which unfortunately provided no answers. Well, it was again the time to send our prayers downwards… wait, no, call the Microsoft Support.

As usual, they were able to help, but we were never particularly enlightened by the real reasons. After some diagnostics, removing and re-installing IIS was the proposed cure; a considerable effort on a server with several heavily configured sites, but we managed – and it worked. We – and I think this includes the support engineer – never got to know if the .NET 2.0 installation was to blame here.

Perhaps it's time to start considering heavier backup plans on 2.0 installations, at least on the most critical servers. It's certainly not common, but pretty nasty when it hits you. Well, at least I hope sharing the experience will save somebody the trouble  of discovering this (and a support ticket).

September 13, 2006 В· Jouni Heikniemi В· One Comment
Posted in: .NET

One Response

  1. Dana - March 7, 2007

    I have just created a windows user control running on the website (kind of ActiveX control) but it is giving me "System.runtime.interopservices.COMException, The handle is invalid". I am running out of time to make my website project goes live. If you could help me. That would be very perfect or give me some hints. Please