Following the guidelines from Turn a simple C# DLL into a COM interop component, I've created a tiny C# COM server:
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[Guid("410B8E64-27DB-40BD-8847-FC3A0E96147D")]
public interface IFactory
{
int PlusOne(int i);
}
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[Guid("207FC3AB-0EFB-459A-B222-41E281F044F9")]
public class Factory : IFactory
{
public int PlusOne(int i) => i + 1;
}
I've created as well a client C# project which just references this COM server. And here is the problem: COM reference is not working, in Dependencies->COM section it is marked with a yellow warning triangle without any further explanations, and types from the COM component are not available in the client code. These projects are published on github. Note, that COM server atomaticly registers itself (regasm) upon rebuild of the project. I'll appreciate any help. The answers like "you can reference your server as a .net assembly directly without need to use COM", are not acceptable, as this is just a test of a part of a bigger workflow which we need to establish.