This project is read-only.

Generation of API documentation for inherited members when DocumentInheritedMembers is false


We are using Sandcastle to generate our API Reference, but we do not want to include inherited members. That's why we have set the DocumentInheritedMembers to false. But for some of our classes we still get inherited members in the documentation. After some testing we found that the issue occurs when the child class and the parent class have similar names. And by similar I mean that the parent class has the same name as the child, but with some more letters at the end. For example:
public abstract class ChildClassBase
    public int PublicProp1 { get; set; }
    public string PublicProp2 { get; set; }
    private int privateProp1 { get; set; }
    private string privateProp2 { get; set; }

public class ChildClass : ChildClassBase
    public string ChildProp1 { get; set; }      
In the documentation of ChildClass you will see descriptions for ChildProp1, PublicProp1 and PublicProp2. The same is valid if the parent class is named ChildClassTest, ChildClassT, etc. But if I rename the parent or the child, for example ChildSubClass and ChildClassBase, the documentation for ChildSubClass will hold only information about ChildProp1.
Just one more thing to add - all visibility properties in our project are set to false.

The issue is reproduced with Sandcastle 1.9.5 and 1.9.6 (I haven't tested it in older version.


EWoodruff wrote Feb 1, 2013 at 8:33 PM

The code that strips out inherited members does an XPath starts-with() comparison to find them. I added a period to the end of the type name to limit what it finds to just those members belonging to the specific type rather than those matching the prefix which was too inclusive. It's fixed for the next release of SHFB.

Also, please note that this project has been discontinued and may not be monitored as frequently and I can't close work items here. For future questions or issues concerning Sandcastle or SHFB, post them over in the Sandcastle Help File Builder project. Thanks.

wrote Feb 22, 2013 at 1:39 AM