Skip to content

C# 14 new syntax for extension methods, xml documentation seems to be broken #54005

@lassevk

Description

@lassevk

Describe the issue or suggestion

I've tested both Rider and Visual Studio Community, and neither shows documentation for my extension methods declared using the new syntax.

Repository with nuget package code:
https://github.com/lassevk/LasseVK.Bootstrapping/tree/0.1.0-prerelease

Nuget package: (0.1.0 is important, as 0.1.1 switched back to old-style extension methods which work)
https://www.nuget.org/packages/LasseVK.Bootstrapping/0.1.0-prerelease

To reproduce, do the following:

  1. Create a new .NET application in C#, console application is fine

  2. Add the following two nuget packages:

    1. Microsoft.Extensions.Hosting
    2. LasseVK.Bootstrapping (pre-release checked, pick 0.1.0)
  3. Replace program.cs code with the following:

        using LasseVK.Bootstrapping;
    
        using Microsoft.Extensions.Hosting;
    
        HostApplicationBuilder builder = Host.CreateApplicationBuilder();
    
        builder.Bootstrap(new ApplicationBootstrapper());
    
        public class ApplicationBootstrapper : IModuleBootstrapper
        {
            public void Bootstrap(IHostApplicationBuilder builder)
            {
                throw new NotImplementedException();
            }
        }
  4. Do a build, or otherwise make sure packages are restored

  5. Hover over the .Bootstrap method to see if documentation is shown (it won't be)

It seems the way the compiler generates a new class, similar to (if I understand the syntax correctly) LasseVK.Bootstrapping.HostApplicationBuilderExtensions.(G)randomnumber<?> and using <inheritdoc ...> to forward the documentation is tripping up both Visual Studio and Rider in this regard.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions