This project is read-only.

Conditional Compilation in XML Comments


Please support conditional compilation within XML documentation comments. This has been a source of pain since portable libraries came on the scene a while ago. Often linked code files are used to share source between different target platforms of the same API; however, as a result often times the documentation comments must change conditionally as well. As of now, there's no good way around this limitation - you have to duplicate the entire XML comments conditionally, rather than just each section or line.

For example, I'd like to do this:
  /// <summary>
  /// Summary for Foo.
  /// </summary>
  /// <remarks>
  /// <para>Foo is great.</para>
#if !PORTABLE_403
  /// <para>Foo works well with <see cref="INotifyCollectionChanged"/>.<para>
  /// <para>Did I mention Foo is great?</para>
  /// </remarks>
  public void Foo() { ... }
INotifyCollectionChanged is not defined in .NET 4.0.3, so when targeting .NET 4.0.3 with a portable library the paragraph referencing it must be elided from the documentation.


davedev wrote Jan 27, 2015 at 9:01 PM