[英]Summary is not showing in the assembly if it is added as a reference
I've created a 'Class Library' in C#, which has many functions with summary (XML documentation comments).我在 C# 中创建了一个“类库”,它有很多功能和摘要(XML 文档注释)。
For example例如
///<summary>
///Adds the two numbres
///</summary>
public void Add()
{
//statements
}
if i use the function in the same namespace, its showing the summary, but if i added it as reference in some ohter workspace(solution) its not showing the summary.如果我在同一个命名空间中使用 function,它会显示摘要,但如果我将它添加为某些其他工作区(解决方案)中的参考,它不会显示摘要。
How to make it visible i other solutions if a added it as a reference, and wat may be the reason for this?如果将其添加为参考,如何使其在其他解决方案中可见,这可能是什么原因?
You need to generate XML documentation for the assembly (a file named myassembly.xml) and copy it alongside your .dll where it's referenced by your other projects. 您需要为程序集生成XML文档(名为myassembly.xml的文件),并将其与.dll一起复制,并由其他项目引用。 See this page in MSDN for instructions.
有关说明,请参阅MSDN中的此页面 。
First and second step copied from @PushParaj's answer.从@PushParaj 的回答中复制的第一步和第二步。 Thanks.
谢谢。
When you compile classes that have xml comment, normally a .xml file is created. 编译具有xml注释的类时,通常会创建.xml文件。 (check the options in Visual Studio)
(检查Visual Studio中的选项)
When you add a reference to such an assembly, make sure the XML file is present. 添加对此类程序集的引用时,请确保XML文件存在。 The documentation is not contained within the assembly but within the xml file.
文档不包含在程序集中,而是包含在xml文件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.