This project has moved and is read-only. For the latest updates, please go here.

Interop Attributes

Mar 14, 2008 at 5:07 AM

I'm using SHFB to document a project that uses attributes from System.Runtime.InteropServices namespace, namely, DLLImportAttribute, StructLayoutAttribute and FieldOffsetAttribute. The output help chm does not include these attributes though. I've enabled 'DocumentAttributes' in GUI and also have edited the file: %SHFB%\Templates\MRefBuilder.config in different ways, including totally removing the following lines:

<namespace name="System.Runtime.InteropServices" expose="false">
<type name="DllImportAttribute" expose="true"/>
<type name="ComVisibleAttribute" expose="true"/>
<type name="GuidAttribute" expose="true"/>
<type name="ClassInterfaceAttribute" expose="true"/>
<type name="InterfaceTypeAttribute" expose="true"/>

But the attributes still did not show up. Also, my classes and methods are internal and I have 'DocumentInternals' enabled.

What do I have to do to make these attributes show up in my generated documentation?

Mar 14, 2008 at 4:29 PM
Edited Mar 15, 2008 at 10:54 PM
There appears to be a bug in MRefBuilder. GuidAttribute and a couple of others come through but several other attributes such as DllImportAttribute, PreserveSigAttribute, StructLayoutKind, FieldOffsetAttribute, and a few other do not even if the filter is completely removed. I'll do some more investigating and will file a bug report in the Sandcastle project with the details.

EDIT: I opened a work item in the Sandcastle project: