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

Constructor Documentation without Constructor

Topics: Developer Forum, User Forum
Jun 15, 2010 at 2:04 PM



I'm going to write a Helper Assembly in VB with many Classes grouping Shared Methods. So these Classes have no constructor and moreover, in the Sandcastle project I set the AutoDocumentConstructors=False. From my point of view all all Classes in the Assembly are defined in a similar way, none of them has a Constructor. Nevertheless the created  document contains Constructo Sections and Missing Hints like the following:

[Missing <summary> documentation for "M:NetAktiv.Helpers.Collections.#ctor"]

Most of the Classes are documented as expected, i.e. no Constructor Section and therefore no "missing" hints. 

I'm using the most recent version of Sandcastle and VB 2010 Express. Any ideas why these sections are generated any why only for some of the classes?

Regards, Rainer 




Jun 15, 2010 at 8:49 PM

The AutoDocumentConstructors property simply indictates whether or not to include auto-generated documentation for any undocumented constructors or those generated by the compiler.  In general, you should leave it set to True.  The compiler will always generate a public default constructor if you don't write one.  The C# compiler won't in certain cases like static classes but as I recall, you can't declare classes static in VB.NET so that may not be an option.  As such, you may just have to remove the unwanted constructors using the ApiFilter project option or explicitly declare a private default constructor so that the compiler doesn't generate a public one for you.



Jun 15, 2010 at 10:33 PM
Hello Eric, creating a private constructor worked for all Classes having only shared methods, e.g. there was no need to create a new object. But some of my Classes need a constructor and so I followed your second suggestion and used the API filter. I guess I had already a filter active, but forgot about this feature (I created the project about one year ago). This would explain why the Missing appeared only for some of my Classes, e.g. the recently created. Thx, Rainer