None of the answers shown so far work completely for me. ReSharper won't convert the see tag into a Ctrl+click-able link (e.g. ) unless it completely resolves.
If the method in the OP were in a namespace called Test
, the completely resolved link to the method shown would be:
<see cref="M:Test.FancyClass`1.FancyMethod``1(`0)"/>
As you may be able to work out, there should only be one backtick before the number of class type parameters, then two backticks before the number of method type parameters, then the parameters are the zero-indexed parameter with the appropriate number of backticks.
So we can see that FancyClass
has one class type parameter, FancyMethod
has one type parameter, and an object of the FancyClass
parameter type will be passed to the method.
As you can more clearly see in this example:
namespace Test
{
public class FancyClass<A, B>
{
public void FancyMethod<C, D, E>(A a, B b, C c, D d, E e) { }
}
}
The link becomes:
M:Test.FancyClass`2.FancyMethod``3(`0,`1,``0,``1,``2)
Or "Class with two type parameters which has a method with three type parameters where the method parameters are ClassType1
, ClassType2
, MethodType1
, MethodType2
, MethodType3
"
As an additional note, I didn't find this documented anywhere and I'm not a genius, the compiler told me all this. All you have to do is create a test project, enable XML documentation, then insert the code you want to work out a link for, and put the start of an XML doc comment on it (///
):
namespace Test
{
public class FancyClass<T>
{
///
public string FancyMethod<K>(T value) { return "something fancy"; }
}
public class Test
{
public static void Main(string[] args) { }
}
}
Then build your project, and the outputted XML documentation includes the link in the doc
->members
->member
element under the attribute name
:
<?xml version="1.0"?>
<doc>
<assembly>
<name>Test</name>
</assembly>
<members>
<member name="M:Test.FancyClass`1.FancyMethod``1(`0)">
</member>
</members>
</doc>