如何从C#XML注释中引用构造函数?

mar*_*ark 23 c# xml constructor comments

是否可以从C#XML注释中引用构造函数而无需使用显式前缀(如M:或T :)?

例如,以下产生编译警告,因为编译器不喜欢".ctor".尝试"PublishDynamicComponentAttribute.#ctor"并不好,
"PublishDynamicComponentAttribute.PublishDynamicComponentAttribute"也不好.

/// <summary>
/// Constructs a new <see cref="PublishEntityAttribute"/> instance.
/// </summary>
/// <seealso cref="PublishDynamicComponentAttribute..ctor(Type)"/>
public PublishEntityAttribute(Type entityFactoryType) :
  base(entityFactoryType)
{
}
Run Code Online (Sandbox Code Playgroud)

我确信类型本身是可见的.

因此,我将使用显式前缀M:,这将删除编译器验证,因此当移动/重命名类型时,cref将无效.

有什么建议?

adr*_*nks 16

您可以像调用它一样指定构造函数,但是使用参数的类型而不是它们的值:


/// <seealso cref="PublishDynamicComponentAttribute(Type)"/>
Run Code Online (Sandbox Code Playgroud)