How to get the normalized XML documentation name of a type?
-
15-07-2021 - |
سؤال
How is it possible to get the name of the type which corresponds to the name used in XML documentation output file?
I thought that XML documentation uses full names, but this is not the case. For example the full name of Collection<long>
is:
System.Collections.Generic.ICollection`1[[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]])
while the XML documentation corresponding to a property of type Collection<long>
is:
System.Collections.Generic.ICollection{System.Int64}
المحلول
XML documentation uses the fully qualified class name; e.g. the namespace and the class name. See http://msdn.microsoft.com/en-us/library/system.type.fullname.aspx
Your example (with PublicKey) is the fully qualified AssemblyName of the class; which is normally used only when you need to dynamically load the Type.
The XML documentation convention for a generic is to use '{T}' to make it easier to type, as in . "Collection" is not used because '<' is special in XML!