I have a project with a single interface marked with ComVisible(true). If I build the project, I get warning MSB3214: “” does not contain any types that can be registered for COM Interop.
If, however, I create an empty class, give it a default constructor and mark it with ComVisible(true), I do not get warning MSB3214. I see the registered class but I do not see the interface in my registry.
What am I missing?
This is by design, in spite of Jays link. Regasm.exe only writes registry keys for concrete classes that implement an interface. The ProgID and the CLSID keys. COM does have registration for interfaces (HKCR\Interfaces) but only proxies get registered there. .NET has no mechanism to create proxies.
An assembly with only interface declarations is only useful to create a type library, allowing other projects to implement them. Creating a type library is not a problem, use Tlbexp.exe