Skip to content

CS1591: Redundant comments are required in all partial method definitions #54103

@mano-cz

Description

@mano-cz

Analyzer

Diagnostic ID: CS1591: Missing XML comment for publicly visible type or member

Analyzer source

Version: SDK 5.0.100

Describe the bug

The public partial method in the public partial class requires XML comments in each partial method definition. The class itself requires the documentation only in one place.

Steps To Reproduce

Prerequisite: XML comments are enabled.

  1. Define the public partial method without implementation inside a public partial class.
  2. In another file: Define the same public partial class with the same public partial method, but now with implementation.
  3. Add XML comment to only one file where the partial method is defined.
  4. CS1591 will pop up on the other file, it does not matter in which file the XML comment was created.

Expected behavior

It would be enough to create only one XML comment on the partial method, the same as with the partial class.

Actual behavior

In order to dismiss CS1591, the partial method has to be documented everywhere or use suppresion.

Additional context

Example:

Without CS1591
image
Second file with CS1591 on partial method
image

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions