如何让 XML 注释出现在不同的项目 (dll) 中?

发布于 2024-08-09 06:50:27 字数 183 浏览 2 评论 0原文

/// <summary>
/// This method does something...
/// </summary>
public void DoSomething() 
{
    // code...
}

当在不同的 .dll 中使用该方法/类等时,注释不会显示。

/// <summary>
/// This method does something...
/// </summary>
public void DoSomething() 
{
    // code...
}

When using that method/class etc... in a different .dll the comments do not show up.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏日浅笑〃 2024-08-16 06:50:27

一些建议:

  • 确保您的编译器配置为在编译作业中发出 XML 文档注释
    • 控制此功能的 Microsoft C# 编译器开关是 /doc,也可以通过项目设置中的 Build 属性页进行配置
  • 。编译器生成的程序集与 DLL 的名称相匹配(即 myAssembly.dll -> myAssembly.xml
  • 当您在另一个项目中使用该程序集时,请确保 XML文件与被引用的 DLL 位于同一目录中。

A couple of suggestions:

  • Make sure that your compiler is configured to emit the XML doc comments as part of the compilation job
    • The Microsoft C# compiler switch that controls this is /doc, and can also be configured via the Build property page in a project's settings
  • Make sure that the XML file produced by the compiler matches the name of the DLL (i.e. myAssembly.dll -> myAssembly.xml)
  • When you use the assembly in another project, make sure that the XML file is in the same directory as the DLL being referenced.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文