Sat 12 Nov 2005
Dealing with “class doesn’t support automation” with ASP Classic and .NET COM interop
Posted by andy under Programming
[5] Comments
I had a problem today when trying to call a C# component from Classic ASP. When I called a method in the C# component I got the error “class doesn’t support automation”.
This was very puzzling because I had already prototyped this to make sure that I could sucessfully call C# from Classic ASP (using both VBScript and Javascript). The C# assembly and class were marked as COMVisible and I had used regasm to register the DLL with COM.
Through a process of elmination I worked out that the problem was that the method had some boolean parameters that I wasn’t initialising with boolean values in my ASP code. I hadn’t completed my ASP page, so the variables being passed to the booleans were in fact set to empty strings.
So the error message is very misleading, as it has nothing to do with the class you are calling not supporting automation.
Once I initialised my booleans correctly the problem went away, which made me a very happy bunny
November 23rd, 2005 at 3:05 pm
Oh how I hate debugging. It’s always worse when the error message puts you on entirely the wrong track. In this case entirely the wrong guage!
December 27th, 2006 at 3:04 pm
Hi there,
If you are looking for a solution for the “Class doesn’t support Automation” error, check out http://www.tucsonhorizonchorus.com/?p=9
December 28th, 2006 at 11:32 pm
Thanks for the comment. I don’t believe the two issues are related though, mine was calling .NET components from ASP, yours is some kind of Javascript problem within IE.
July 8th, 2008 at 9:15 pm
Hi Andy,
I saw your post on an other website, regarding debugging com-interop using VS.net. I am in the same boat and would like to know how to debug a C# (dll) being used in classic ASP.
I do attach to dllhost.exe but don’t know how to access the dll.
thanks in advance,
Srini
December 22nd, 2008 at 9:15 am
Not only booleans – any parameter with wrong type will generate this error since the methos declaration does not exist