Skip to content

C# cref or \ref doesn't work without full namespace, even for classes in same namespace #10766

@runevision

Description

@runevision

Describe the bug
Referencing another class (in this case called TopLayerDependency) in the same namespace with <see cref="TopLayerDependency"/> does not create a link when the class name is not qualified with the (common) namespace. In the output I see
unable to resolve reference to 'TopLayerDependency' for \ref command.

Screenshots

MissingLink

To Reproduce
Default Doxyfile without modifications used to reproduce the issue.

Place these two files in the folder Doxygen is run from:

File GenerationSource.cs

namespace Runevision.LayerGen {
    /// <summary>
    /// Unity component that creates a <see cref="TopLayerDependency"/>. <br/>
    /// Unity component that creates a \ref TopLayerDependency. <br/>
    /// Unity component that creates a <see cref="Runevision.LayerGen.TopLayerDependency"/>. <br/>
    /// Unity component that creates a \ref Runevision.LayerGen.TopLayerDependency.
    /// </summary>
    public class GenerationSource : MonoBehaviour { }
}

File TopLayerDependency.cs

namespace Runevision.LayerGen {
    /// <summary>
    /// All generation starts with one or more top level dependencies at the root.
    /// </summary>
    public class TopLayerDependency { }
}

Expected behavior
I would expect class names in the same namespace to be turned into links without having to specify the namespace.

Version
1.10.0 (GIT-NOTFOUND)
Doxygen installed via brew
macOS 12.5.1

Additional context
None of my other cross references get turned into links either (for example references from one method to another method in the same class). It seems like something is very broken about Doxygen reference resolution for xmldoc and/or C#, but I think this report here is the simplest demonstration, so let's start with that. With any luck, the fix for this will fix the other ones too.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions