This project has moved. For the latest updates, please go here.

Weird behavior for COM-imported interface members

Topics: Developer Forum, User Forum
Mar 29, 2012 at 6:16 PM

My issue is not directly related to SHFB, which is not at fault here. I just thought you folks could probably help me out or provide some insights.

Basically, the XML documentation file generated by C# compiler contains unresolved references in a very specific case: COM-imported interface members. I described the issue in detail at stackoverflow so I will rather not reiterate the post here in its entirety.

Can someone please explain this behavior or confirm it is a bug?

Mar 29, 2012 at 7:41 PM

Is this a .NET 4.0 app?  If so, it could be caused by the compiler using dynamic types behind the scenes.  If your project contains a reference to Microsoft.CSharp that's an indication that dynamic types could be used.  If you remove the reference and do a build, you'll get compiler errors about it being unable to resolve the types needed for the dynamic code if that is the case.  Doing that in my add-in projects flags the instances where I'm using Document and a few other types as needing the dynamic binder types.  That could be why the compiler resolves the class members but not the interfaces.  For instances where dynamic types are used, they won't be resolved until runtime.  As such, there's nothing there for the compiler to use for the XML comments member ID.  That's my theory anyway.