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