Monday, 9 September 2013

E_NOINTERFACE exception - Basic COM/C# interop

E_NOINTERFACE exception - Basic COM/C# interop

I'm trying to create a managed COM client against an unmanaged COM server
application. I have the server IDL file, that I have generated the managed
assembly by using MIDL compiler to get the TLB -> TlbImp -> DLL. I have
run REGASM on this dll, and run /regserver on the server EXE. I have
referenced the interop dll in my C# client.
The coclass is created correctly and my server application boots up when I
run the client.
However, when I try to call any method on the server, I get an
InvalidCastException that the interface that the coclass implements could
not be found.
I have searched everywhere and nobody seems to be having this issue. Could
somebody please help me with this? I am new to COM/C# interop and would
like to know if I have missed a step.

No comments:

Post a Comment