Is it possible to obtain class summary at runtime?

后端 未结 6 1024
無奈伤痛
無奈伤痛 2020-12-10 02:34

Is it possible to obtain class summary at runtime in C#? I would like to obtain class summary through reflection and then write it to console. By class summary I mean summar

6条回答
  •  萌比男神i
    2020-12-10 03:11

    You can, if you emit an XML documentation file. The process would involve using reflection to get all the public members of the type, then using XPath, read the documentation from the generated XML document.

    UPDATE: to include the XML doc in your dll/exe, just add it as an embedded resource, and compile twice if documentation changes.

提交回复
热议问题