Skip to content

Resolve /// <inheritdoc /> content when generating Markdown #68

Description

@jeffpatton1971

Problem

Xml2Doc generates a method heading for members documented only with /// <inheritdoc />, but it does not emit the inherited summary, parameter descriptions, return documentation, or remarks from the implemented interface member.

This leaves generated API documentation structurally present but largely empty.

Observed with:

  • Xml2Doc.MSBuild 1.4.0-preview.86-g10fb1f6
  • .NET 9
  • Multi-project solution
  • Concrete implementation of a documented interface

Minimal example

public interface IExampleService
{
    /// <summary>
    /// Executes an example operation.
    /// </summary>
    /// <param name="request">The request to execute.</param>
    /// <param name="cancellationToken">Cancellation token.</param>
    /// <returns>The execution result.</returns>
    /// <remarks>
    /// Additional behavioral guidance for callers.
    /// </remarks>
    Task<ExampleResult> ExecuteAsync(
        ExampleRequest request,
        CancellationToken cancellationToken = default);
}

internal sealed class ExampleService : IExampleService
{
    /// <inheritdoc />
    public Task<ExampleResult> ExecuteAsync(
        ExampleRequest request,
        CancellationToken cancellationToken = default)
    {
        // implementation
    }
}

Actual output

The generated Markdown contains the concrete method heading but omits the inherited documentation:

## Method: ExecuteAsync(ExampleRequest, CancellationToken)

No summary, parameters, returns, or remarks follow the heading.

Expected output

Xml2Doc should resolve the inherited interface member and emit its XML documentation for the concrete method, including:

  • summary
  • parameter descriptions
  • return documentation
  • remarks
  • exception/type-parameter documentation when present

Impact

Consumers either receive incomplete generated API docs or must duplicate full XML documentation on every implementation method, which creates documentation drift between interfaces and implementations.

This was observed in Rackspace.BAT.Core.Engine.Execution.BatExecutionService, where both ExecuteAsync overloads use /// <inheritdoc /> and their generated Markdown lost the interface documentation.

Suggested acceptance criteria

  • Resolve <inheritdoc /> for interface implementations.
  • Resolve overloads by full member signature, not name alone.
  • Preserve inherited summary, param, returns, remarks, exception, and typeparam elements.
  • Support both <inheritdoc /> and <inheritdoc cref="..." />.
  • Add regression tests covering overloaded interface methods.
  • Emit a useful warning when inherited documentation cannot be resolved instead of silently generating an empty member section.

Current workaround

Duplicate the complete XML documentation on the implementation member instead of using /// <inheritdoc />.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions