Exposing.NET assembly as COM 101
Posted
by Jan Zich
on Stack Overflow
See other posts from Stack Overflow
or by Jan Zich
Published on 2010-03-25T11:41:59Z
Indexed on
2010/03/25
11:53 UTC
Read the original article
Hit count: 460
I have trouble to expose a .NET assembly in COM. It seems that I must be missing some basic step because I think I followed all tutorials and documentation I found as well as common sense, but still when I do (in a test VBScript):
Set o = CreateObject("MyLib.MyClass")
It keeps saying that the object cannot be created.
Here are the steps I have done:
- I have simple one method dummy class with no attributes.
- The class is in a class library which has "Make assembly COM-visible" ticked in Visual Studio.
- The class library is signed.
- The DLL is registered via RegAsm.exe with the /codebase parameter (I don’t want / cannot add the DLL to GAC).
Just to be sure, I tried to copy the library to the same directory as the test VBScript, but it does not help.
Edit: I should have mentioned that the I can instantiate the class in COM if I put the DLL into GAC.
© Stack Overflow or respective owner