Visual Studio does it; Reflector does it; and now I want to as well 🙂
I want to retrieve the XML documentation for some members in some framework assemblies (i.e. mscorlib.dll, System.dll, etc). I assume this would involve:
- finding the XML file for the assembly,
- navigating to the appropriately named child element, and
- retrieving the desired items (
<summary>,<remarks>, etc)
Where are the XML files kept for framework assemblies? Any points on deciphering the XMLDOC naming scheme? Are there any libraries out there that will make this process easier?
Find xml
For assembly.dll it is named as assembly.xml, but installed by Framework SDK, Runtime itself doesn’t contain .xml files. Users do not need API documentation.
Location is a bit more complex. It can be side by side with the dll, in the subdirectory named after current locale (e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\en) or even in some weird directory nearby. I would suggest searching for it in the way runtime looks for satellite assemblies.
Find element
To find element, you should prepare so called ‘xml-doc ID’ from the metadata. AFAIR it is documented in C# language spec, and a bit in MSDN. See Processing XML documentation.