We are working with an existing native application (most likely written in VB) that loads assemblies and calls methods with "Late Binding." We do NOT have access to its source code.
We want to implement this interface in C#, and have the native application call our C# assembly.
Is this something that's possible?
Is this anything we have to do beyond matching the method names and method signatures to make it work?
These are the steps required to make it work:
[ComVisible(true)]
, and make sure to give it a unique [Guid]
attributeProgId
to your class which is normally MyNamespace.MyClass
, but you can add an attribute on your class to override this as well[DispId]
attributes for each method that will be calledregasm.exe
on your assemblyAnd voila! Native code can call your C# via "late binding". I, of course, had to setup several registry keys to make my native application know how to load my assembly, but all is working.