Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Analyzer throws NRE when visiting certain cref XML comments #2724

Closed

Description

@sbomer

Splitting this off from #2718

There's a NRE because we visit generic instantiations for crefs in XML comments, where the generic argument might be a string representing a generic parameter. We try to access the ContainingSymbol which is null

=> new string[] { GenericParameter.TypeParameterSymbol.Name, GenericParameter.TypeParameterSymbol.ContainingSymbol.GetDisplayName () };

and this causes a NRE in GetDisplayName. Example:
Example: https://github.com/dotnet/aspnetcore/blob/61506cd77e9f2c457afb27e487789585bea90264/src/JSInterop/Microsoft.JSInterop/src/IJSObjectReference.cs#L18

This only repros with <GenerateDocumentationFile>true</GenerateDocumentationFile>.

We should fix this by simply not visiting XML comments.

Activity

  1. added a commit that references this issue on Apr 8, 2022
    3292e23
  2. added a commit that references this issue on Nov 16, 2022
    b754c6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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