是否有.NET API来读取XML注释文档文件注释、文档、文件、NET

2023-09-03 09:35:25 作者:相愛沒冇那麽容易﹌

在此question我看到微软船舶的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.

用例是,我们允许自定义(读取第三方)类型/组件在我们的系统中使用,并在用户界面中选择这些的时候,我们要提取的文件所指定的自定义类型/装配创建者或如果没有可用的提供其他默认设置。

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.

推荐答案

我保持在$ C的 Jolt.NET 项目$ CPLEX,并实施了一项功能,执行这个非常任务。请参阅颠簸库以获取更多信息。

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...).