.net 中是否有 API 来读取 XML 注释文档文件 [英] Is there an API in .net to read XML comment documentation file

查看:23
本文介绍了.net 中是否有 API 来读取 XML 注释文档文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这个问题中 我看到微软为 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.

用例是我们允许在我们的系统中使用自定义(读取第 3 方)类型/程序集,并且在 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.

推荐答案

我维护 Jolt.NET 项目CodePlex 并实现了一个功能来执行这个任务.有关详细信息,请参阅 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 中的元数据类型(即MethodInfoPropertyInfo 等...).

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆