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 ;)