Can we selectively generate XML documentation in Visual Studio?

I'm looking for perhaps an attribute or something that I could use to flag "I want this in my xml documentation", so like a whitelist. The situation is that I wish to generate xml documentation for certain controllers to be displayed in swagger. However, many things should NOT be documented - especially auto-generated code such as CRM proxy types which contains hundreds of thousands of unwanted definitions. I have enabled generate "Xml Documentation" in my project settings and I have disabled the warning about undocumented public items so automated builds complete in reasonable time but Visual Studio is generating an 8.1mb xml documentation file which Swagger is taking a long time to load. 90% of this is auto-generated proxy nonsense. I want instead to be able to say "document this file" in the controllers I care about - is this possible?

750k 181 181 gold badges 1.4k 1.4k silver badges 1.5k 1.5k bronze badges asked Feb 25, 2020 at 10:50 David Burford David Burford 791 2 2 gold badges 8 8 silver badges 18 18 bronze badges

1 Answer 1

I'm not aware of a way how to do it directly without any tool. This can be done with VSdocman (I'm the author of it). It can generate your own XML doc file. You can then customize what to document, such as specific files/folders, regex filters for signatures and attributes, accessibility (public/private/. ), special XML doc tag and others.