I have a fairly complex dll which contains two namespaces, as well as a few classes that do not belong to a namespace at all.
For the sake of simplicity, I have a test dll which has two classes in it:
namespace MyAsmNamespace{
public MyClass{
public int doSomething(){ return 1;}
}
}
and
public MySecondClass{
public int doSomethingElse(){ return 2;}
}
I am trying to use objects from this dll within a classic ASP page, using CreateObject.
I have registered the dll using >RegAsm.exe /codebase /tlb
And then I load the dll using set obj = CreateObject("MyAsmNamespace.MyClass")
Now the classes with namespaces specified work just fine, but for the class that doesn't have a namespace, I don't know what to do. I tried set obj = CreateObject("MySecondClass")
, but that doesn't work (I get an ActiveX Component Can't Create Object error)
I looked in IL DASM, and MySecondClass is in the assembly, but not listed under a namespace. Looking in regedit, I can see that MyAsmNamespace.MyClass is registered, but I cannot find MySecondClass anywhere.
Does MySecondClass have to be in a namespace to be referenced in classic asp or is there a default namespace it becomes a part of?
ComVisible
? Any other differences, besides the namespace? – noseratio