How to use XML documentation files

半世苍凉 提交于 2019-12-04 16:57:03

问题


  1. When using an external assembly which comes with an XML documentation file, how do I get visual studio to find it?

  2. When having an XML documentation file, is there a program or xml transform file or something I can use to look at it in a nice way? Not necessarily as complex as the msdn documentation viewer thingy, but at least something nicer than the pure xml...


回答1:


1: you simply drop it in the same folder as the dll

2: does it need to be persisted? For "live" use, both the VS IDE and "reflector" allow you to review the documentation (against the types/members/etc). There are tools to transform it, but I've never bothered. Sandcastle may be worth a look, but it was never nice to me ;-p




回答2:


Regarding 2: You should be able to look at a "pretty version" of the documentation using the Object browser (View > Object Browser (Ctrl W + J)) and then browse your way to the class for which to review the documentation. I used the Object Browser to review my own documenation since it is more reader friendly than the xml files or the comments.




回答3:


Answer to your first question: the xml should have the same name as the assembly and be right next to it. So if you have an assembly called Svish.dll then your documentation file should be Svish.xml and be in the same directory.




回答4:


1) The documentation file must have the same name as the assembly name, with the added extension '.xml', and reside in the same directory as its corresponding assembly. So for example, you have an 'MyCompany.MyNamespace.dll' and a 'MyCompany.MyNamespace.dll.xml' file in the same directory.

2) NDOC can generate some dirrent formats of documentation.



来源:https://stackoverflow.com/questions/665626/how-to-use-xml-documentation-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!