Conditional Compilation in XML Comments
See original GitHub issuePlease 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.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:3
- Comments:24 (15 by maintainers)
Top Results From Across the Web
Is there a way to use conditional compilation symbols in xml
As the XML files are not compiled, there is no such thing like Conditional Compilation. So I identify the fact that you have...
Read more >Using conditional compilation inside an app's XML file
Hello guys,. Do you know how to use the value of conditional compilation variable inside the app's XML file?
Read more >How XSL and XML Help in Java's Conditional Compilation
Conditional compilation is a rather extensive concept. In the context of this article, with the meaning “conditional compilation,” we will have ...
Read more >conditional compilation by xml and VS or application ...
I weave an aspect into an generic external library to disable logging. So far it is working perfect by a xml configuration and...
Read more >Insert XML documentation comments - Visual Studio
The Insert Comment command that automatically inserts XML documentation comments is available in C# and Visual Basic. However, you can manually ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gafter Do you still have the automated tool for moving these over? Depending on the role/scope I play in moving some of the documentation comment requests forward, I could certainly see this as one of the relevant ones.🔗 This was already moved to dotnet/csharplang#295.
So, we have a use for this in Dapper as well, same situation since some members we
<see cref />
aren’t in .NET Core. For example:…which of course won’t compile. Can we get some love here?