R# cannot resolve enum member in xmldoc comment

public IconType IconType { get; set; }

/// <summary>
/// Gets or sets the well known icon id.
/// Only applicable if <see cref="IconType" /> is <see cref="IconType.WellKnownIcon" />.
/// </summary>
public int WellKnownIconId { get; set; }

This code does work from a VS perspective - the first cref references the field, the second references the enum member.

However, R# shows a warning: "Could not resolve 'WellKnownIcon'"

Is this a known limitation or a bug?

(R# Ultimate 2019.3.3, Visual Studio 2017)

Comment actions Permalink

I suspect it's getting confused between the enum type and the property of the same name. Try prefixing the reference with the member type identifier:

<see cref="F:IconType.WellKnownIcon" />.


Comment actions Permalink

If I add F: in front, it does no longer syntax-highlight it as an enum, but yes, the warning is gone.

However, shouldn't the cref change when the enum member is renamed through the resharper rename tool? Because it doesn't.

Comment actions Permalink

The other option would be to fully-qualify the enum type name:

<see cref="YourNamespace.IconType.WellKnownIcon" />

Please sign in to leave a comment.