Groups | Blog | Home
all groups > dotnet interop > october 2005 >

dotnet interop : .NET/COM Interop without registration (xcopy deployment) ?


ulrik NO[at]SPAM e-mail.dk
10/12/2005 12:26:05 AM
Hi,

I have an plugin application (i.e. my application consists purely of
dlls) that is both C++ COM and C# .NET. My various COM and .NET objects
interact both ways using interop.

I would like to deploy my application using xcopy, i.e. without
registering anything on the target machine.

I'm aware that reg-free COM activation can help my objects create COM
objects from classes that are not registered. But how can I do this
when my app does not have an exe?

And is there a way for a COM object to create a .NET object if the .NET
assembly hasn't been registered using regasm?

Thanks in advance!
Ulrik
ulrik NO[at]SPAM e-mail.dk
10/12/2005 2:55:12 AM
I found the answer to one of my questions: A .NET assembly can create a
COM instance from a non-registered COM dll as follows:

1) Load typelib using API function LoadTypeLibEx
2) Create interop assembly using
TypeLibConverter.ConvertTypeLibToAssembly.
3) Create instance from interop assembly using
AssemblyBuilder.CreateInstance.

But my other question remains: How can a COM object create a .NET
object from an assembly that has not been registered using regasm? Or
in other words, is there a way to create the COM Callable Wrapper
without CoCreateInstance?

/Ulrik
AddThis Social Bookmark Button