I'm developing a DCOM server in .NET 4 (VS2010, C#). By itself, this is working fine.
Now, I also need to develop a .NET client for this DCOM server, but I am unable to add a reference to the TypeLib. Visual Studio will tell me the type library was exported from a .NET assembly and cannot be added as a reference.
Answers to this question suggests that I should be able to use TlbImp.exe
to generate a wrapper assembly, but it will refuse to do so as well:
TlbImp : error TI1029 : Type library 'MyWrapper' was exported from a CLR assembly and cannot be re-imported as a CLR assembly.
I understand that from a purely .NET perspective, it may not make a lot of sense to use DCOM for this. However, the same server should also be accessible from non .NET applications.
I have tried converting my tlb to IDL and regenerating the tlb from that, but this does not fool Visual Studio.
Perhaps it is possible to modify the IDL slightly before regenerating, or is there some way to force the use of DCOM, even though both server and client are written in .NET?