在.net中有一个API来读取XML注释文档文件 [英] Is there an API in .net to read XML comment documentation file
问题描述
在此问题我看到microsoft装载了BCL的XML文档文件。我想知道是否有人知道是否有.net内的API,可以在运行时查看。我知道我们可以使用XML api手动解析文件。
In this question I see that microsoft ships the XML documentation files for the BCL. I wonder if anyone knows if there an API within .net that can be used to look this up at runtime. I know we can parse the files manually using the XML api.
用例是我们允许在系统中使用自定义(读取第三方)类型/程序集,并且在UI中选择这些内容时,我们想提取自定义类型/程序集创建者指定的文档,或者如果不可用,则提供其他默认值。
The use case is that we allow custom (read 3rd party) types/assemblies to be used in our system, and when selecting these in the UI, we'd like to extract the documentation as specified by the custom type/assembly creator or if not available provide other defaults.
推荐答案
我在CodePlex上维护了 Jolt.NET 项目,并实施了一个功能这个任务。有关详细信息,请参阅 Jolt 库。
I maintain the Jolt.NET project on CodePlex and have implemented a feature that performs this very task. Please refer to the Jolt library for more information.
本质上,库允许您使用 System.Reflection
(即 MethodInfo
, PropertyInfo
等)。
In essence, the library allows you to programatically locate and query an XML doc comments file for an assembly using the metadata types in System.Reflection
(i.e. MethodInfo
, PropertyInfo
, etc...).
这篇关于在.net中有一个API来读取XML注释文档文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!