I’d like to dynamically load and use a .Net assembly created in C# from a Delphi Win32 application. My classes and interfaces are marked as ComVisible, but I would like to avoid registering the assembly. Is this possible?
P.S. I found here link text another good discussion on the topic, but it is more around hosting the CLR. Which begs a question – why would you host CLR versus using ClrCreateManagedInstance?
Strangely enough, I couldn’t find an answer on StackOverflow, and there is not much on the Net, especially for Delphi. I found the solution from examples posted here. Here’s what I got at the end:
BTW, depending on the situation, you might want to load mscoree.dll dynamically, because it might be not present on the system (XP with no .Net Framework)
EDIT: Unfortunately, this was deprecated and stopped working with .Net4 as I just found out. This leaves only two options – CLR hosting and unmanaged export. Also, debugging of .Net4 COM code is broken.