Visual Studio Development Bookmark and Share   
 index > Developer Documentation and Help System > XML Comments
 

XML Comments

is there a way to say that this particular class in the project to be not included in comments xml generated when we compile the project with /doc option. I guess there is some annotation inside the class to say don't include the xml comments documentation
masked avenger  Wednesday, September 30, 2009 7:43 PM
There isn't a way to get the compiler to exclude member comments. If you are using a tool such as Sandcastleyou can use its API filter in conjunction with the IntelliSense build component to generate a comments file that only includes the items that you want. If using the Sandcastle Help File Builder, you can add the IntelliSense build component to the help project using the ComponentConfigurations project property. The API filter is controlled via the ApiFilter project property and can be used along with the other filtering properties in the Visibility category to remove unwanted members.

Eric
  • Proposed As Answer byEWoodruff Thursday, October 01, 2009 12:02 AM
  •  
EWoodruff  Thursday, October 01, 2009 12:01 AM
As already stated, VS itself cannot do it directly. It depends on which tool you use for further processing. Our VSdocman , in addition to API filters, supports special <compilewhen> tag directly in comments. This allows exactly what you need. Based on this, VSdocman generates proper final documentation or XML doc file.

Peter Macej, VSdocman - Commenter and generator of class documentation for C#, VB .NET and ASP .NET
  • Proposed As Answer byPeter Macej Thursday, October 01, 2009 7:00 AM
  •  
Peter Macej  Thursday, October 01, 2009 6:57 AM
Hi,

You can use conditional compilation.  For example:

#if !DEBUG
/// <summary>
/// This summary will not be included in Debug builds (because the DEBUG symbol is defined).
/// If you set the /doc option for Release builds only, then you're all set.
/// </summary>
#endif
public void MyClass { }

You could create your own symbol as well; e.g., DOC

#if DOC
/// <summary>Include this comment if the DOC symbol is defined.</summary>
#endif

- Dave
http://davesexton.com/blog
Dave Sexton  Friday, October 02, 2009 11:20 PM

You can use google to search for other answers

Custom Search

More Threads

• how to make a collection node opened by default in a xml tree-toc
• Dynamic help causes constantly increasing memory usage
• How to insert XML fragment in the XML Documentation?
• Inheritance hierarchy incorrect for nested types
• Express editions documentation
• Including /doc:comments.xml into CHM file using Sandcastle
• SandCastle error
• Missing Local Help in Visual Basic 2008
• Documenting Enum Values
• exe not running properly in vista operating system