Skip to content

Conditional Compilation in XML Comments #96

@RxDave

Description

@RxDave

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>
#endif
  /// <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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions