简体   繁体   English

我们可以在 Visual Studio 中选择性地生成 XML 文档吗?

[英]Can we selectively generate XML documentation in Visual Studio?

I'm looking for perhaps an attribute or something that I could use to flag "I want this in my xml documentation", so like a whitelist.我正在寻找一个属性或一些我可以用来标记“我想要在我的 xml 文档中”的属性,就像一个白名单。

The situation is that I wish to generate xml documentation for certain controllers to be displayed in swagger.情况是我希望为某些控制器生成 xml 文档以 swagger 显示。 However, many things should NOT be documented - especially auto-generated code such as CRM proxy types which contains hundreds of thousands of unwanted definitions.然而,很多事情不应该被记录下来——尤其是自动生成的代码,比如包含数十万个不需要的定义的 CRM 代理类型。

I have enabled generate "Xml Documentation" in my project settings and I have disabled the warning about undocumented public items so automated builds complete in reasonable time but Visual Studio is generating an 8.1mb xml documentation file which Swagger is taking a long time to load.我在我的项目设置中启用了生成“Xml 文档”,并禁用了有关未记录的公共项目的警告,因此自动构建在合理的时间内完成,但 Visual Studio 正在生成一个 8.1mb 的 xml 文档文件,Swagger 需要很长时间才能加载该文件。 90% of this is auto-generated proxy nonsense.其中 90% 是自动生成的代理废话。 I want instead to be able to say "document this file" in the controllers I care about - is this possible?我希望能够在我关心的控制器中说“记录这个文件” - 这可能吗?

I'm not aware of a way how to do it directly without any tool.我不知道如何在没有任何工具的情况下直接做到这一点。 This can be done with VSdocman (I'm the author of it).这可以通过VSdocman完成(我是它的作者)。 It can generate your own XML doc file .它可以 生成您自己的 XML doc 文件 You can then customize what to document, such as specific files/folders, regex filters for signatures and attributes, accessibility (public/private/...), special XML doc tag <compilewhen> and others.然后,您可以自定义要记录的内容,例如特定文件/文件夹、签名和属性的正则表达式过滤器、可访问性(公共/私有/...)、特殊 XML 文档标签 <compilewhen> 等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM