SauceControl.InheritDoc 0.2.0

Automatically replace <inheritdoc /> tags with inherited documentation at build time

There is a newer version of this package available.
See the version list below for details.
Install-Package SauceControl.InheritDoc -Version 0.2.0
dotnet add package SauceControl.InheritDoc --version 0.2.0
<PackageReference Include="SauceControl.InheritDoc" Version="0.2.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SauceControl.InheritDoc --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

InheritDoc

This MSBuild Task takes a different approach from other documentation post-processing tools. By integrating with MSBuild, it has access to the exact arguments passed to the compiler, including assembly references and the output assembly and XML documentation file paths. As it processes inheritdoc elements, it is able to more accurately resolve base types whether they come from the target framework, referenced NuGet packages, or project references. This more accurate resolution of references means it can be more clever about mapping documentation from base types and members to yours. For example, it can identify when you change the name of a method parameter from the base type’s definition and update the documentation accordingly.

How to Use It

  1. Add some inheritdoc tags to your XML documentation comments.

    This tool’s handling of inheritdoc tags is based on the draft design document used for the new prototype Roslyn support, which is in turn based on the inheritdoc support in Sandcastle Help File Builder (SHFB).

  2. Add the SauceControl.InheritDoc NuGet package reference to your project.

    This is a development-only dependency; it will not be deployed with or referenced by your compiled app/library.

  3. There is no 3.

    Once the package reference is added to your project, the XML docs will be processed automatically with each build.

How it Works

The InheritDoc task inserts itself between the CoreCompile and CopyFilesToOutputDirectory steps in the MSBuild process, making a backup copy of the documentation file output from the compiler and then processing it to replace inheritdoc tags. The output of InheritDoc is then used for the remainder of your build process. The XML documentation in your output (bin) folder will be the processed version. If you have further steps, such as building a NuGet package, the updated XML file will used in place of the original, meaning inheritdoc Just Works™.

This enhances the new support for inheritdoc in Roslyn (available starting in the VS 16.4 preview builds), making it available to all downstream consumers of your documentation. When using tools such as DocFX, you will no longer be subject to limitations around inheritdoc tag usage because the documentation will already have those tags replaced with the upstream docs.

InheritDoc

This MSBuild Task takes a different approach from other documentation post-processing tools. By integrating with MSBuild, it has access to the exact arguments passed to the compiler, including assembly references and the output assembly and XML documentation file paths. As it processes inheritdoc elements, it is able to more accurately resolve base types whether they come from the target framework, referenced NuGet packages, or project references. This more accurate resolution of references means it can be more clever about mapping documentation from base types and members to yours. For example, it can identify when you change the name of a method parameter from the base type’s definition and update the documentation accordingly.

How to Use It

  1. Add some inheritdoc tags to your XML documentation comments.

    This tool’s handling of inheritdoc tags is based on the draft design document used for the new prototype Roslyn support, which is in turn based on the inheritdoc support in Sandcastle Help File Builder (SHFB).

  2. Add the SauceControl.InheritDoc NuGet package reference to your project.

    This is a development-only dependency; it will not be deployed with or referenced by your compiled app/library.

  3. There is no 3.

    Once the package reference is added to your project, the XML docs will be processed automatically with each build.

How it Works

The InheritDoc task inserts itself between the CoreCompile and CopyFilesToOutputDirectory steps in the MSBuild process, making a backup copy of the documentation file output from the compiler and then processing it to replace inheritdoc tags. The output of InheritDoc is then used for the remainder of your build process. The XML documentation in your output (bin) folder will be the processed version. If you have further steps, such as building a NuGet package, the updated XML file will used in place of the original, meaning inheritdoc Just Works™.

This enhances the new support for inheritdoc in Roslyn (available starting in the VS 16.4 preview builds), making it available to all downstream consumers of your documentation. When using tools such as DocFX, you will no longer be subject to limitations around inheritdoc tag usage because the documentation will already have those tags replaced with the upstream docs.

Release Notes

See https://github.com/saucecontrol/InheritDoc/releases for release-specific notes.

  • .NETFramework 4.6

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

Showing the top 1 GitHub repositories that depend on SauceControl.InheritDoc:

Repository Stars
saucecontrol/PhotoSauce
MagicScaler high-performance, high-quality image processing pipeline for .NET

Read more about the GitHub Usage information on our documentation.

Version History

Version Downloads Last updated
1.0.0 5,668 2/16/2020
0.4.0 3,169 10/24/2019
0.3.0 449 10/4/2019
0.2.0 86 9/30/2019
0.1.0 90 9/27/2019