Automation Error when instantiating a .Net COM visible class

You forgot the /codebase option in the Regasm.exe command line.

Without it, you'll have to strong-name the assembly and put it in the GAC with gacutil.exe. Good idea on the client machine, just not on yours.


If you are running on a 64bit processor with your project compiling as 'CPU-Any' you will either need to compile only for x86 or register the dll in the 64bit COM+ space.

Example of both 32 and 64bit regasm:

%windir%\Microsoft.NET\Framework\v4.0.30319\regasm "Contoso.Interop.dll" /tlb:Contoso.Interop.tlb /codebase Contoso.Interop

%windir%\Microsoft.NET\Framework64\v4.0.30319\regasm "Contoso.Interop.dll" /tlb:Contoso.Interop.tlb /codebase Contoso.Interop