Skip to content

XML Documents for Positional Records #52663

@danstur

Description

@danstur

According to #44571 it should be possible with Visual Studio 16.9 to specify xml documents for auto generated properties based on the primary constructor.

When using VS 16.9.3 I can't seem to get this to work. Am I not using the correct syntax or is there still a problem?

Using the following definitions:

/// <summary>
/// Class description.
/// </summary>
/// <param name="Baz">Foo-Baz description</param>
public sealed record Foo(string Baz)
{
}

public sealed class Bar
{
	/// <summary>
	/// Bar-Baz description
	/// </summary>
	public string Baz { get; init; }

	public Bar(string baz)
	{
		Baz = baz;
	}
}

I get the following results:
Record
Classic

The generated documentation file also does not include the information:

<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Test</name>
    </assembly>
    <members>
        <member name="T:Test.Foo">
            <summary>
            Class description.
            </summary>
            <param name="Baz">Foo-Baz description</param>
        </member>
        <member name="M:Test.Foo.#ctor(System.String)">
            <summary>
            Class description.
            </summary>
            <param name="Baz">Foo-Baz description</param>
        </member>
        <member name="P:Test.Bar.Baz">
            <summary>
            Bar-Baz description
            </summary>
        </member>
    </members>
</doc>

PS: I originally wrote this as a comment, but since the other issue is already closed and I didn't get any feedback in the last five days, I thought it might be more sensible to create a new issue to track this.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Misc

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions