合并 DLL,Intellisense 不拾取单独的 XML 文档文件

发布于 2024-08-16 21:42:30 字数 951 浏览 3 评论 0原文

我使用 ILMerge 将多个 C# 项目 DLL 合并为整个解决方案的单个 DLL。我让每个项目都为 Intellisense 生成其文档的 .XML 文件,当我尝试在另一个解决方案中使用合并的 DLL 作为参考时,我无法显示这些注释。我将这些文件全部放在同一目录中:

  • MergedProjectDlls.dll
  • Project1.XML
  • Project2.XML
  • Project3.XML
  • Project4.XML

我尝试将单个项目 XML 文件重命名为 MergedProjectDlls.XML,然后在 Visual Studio 中删除并重新添加引用,但 Intellisense 仍然没有接收到我重命名的项目 XML 文件中的注释。

无论如何,我希望以某种方式将所有这些项目 XML 文件合并到一个名为 MergedProjectDlls.XML 的文件中。这可能吗?当它与 MergedProjectDlls.dll 位于同一目录中时,Intellisense 会自动识别它吗?

编辑:刚刚在MSDN上找到了这个:

要将生成的 .xml 文件与 IntelliSense 功能配合使用,请让 .xml 文件的文件名与您要支持的程序集相同,然后确保 .xml 文件与以下文件位于同一目录中:大会。因此,当在 Visual Studio 项目中引用该程序集时,也会找到 .xml 文件。

还有:

除非使用 /target:module 进行编译,否则文件将包含指定文件名称的标签,该文件包含编译输出文件的程序集清单。”

I use ILMerge to merge several of my C# project DLLs into a single DLL for the whole solution. I have each project produce a .XML file of its documentation for Intellisense, and I'm having trouble getting those comments to show up when I try to use my merged DLL as a reference in another solution. I have these files all in the same directory:

  • MergedProjectDlls.dll
  • Project1.XML
  • Project2.XML
  • Project3.XML
  • Project4.XML

I tried renaming a single project XML file to be MergedProjectDlls.XML then removing and re-adding the reference in Visual Studio, but Intellisense still wasn't picking up on the comments that I know are there in the project XML file I renamed.

I was hoping to somehow merge all these project XML files into one titled MergedProjectDlls.XML anyway. Is that possible? Would Intellisense then pick up on it automatically when it's in the same directory as MergedProjectDlls.dll?

Edit: just found this on MSDN:

To use the generated .xml file for use with the IntelliSense feature, let the file name of the .xml file be the same as the assembly you want to support and then make sure the .xml file is in the same directory as the assembly. Thus, when the assembly is referenced in the Visual Studio project, the .xml file is found as well.

And also:

Unless you compile with /target:module, file will contain tags specifying the name of the file containing the assembly manifest for the output file of the compilation."

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

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

发布评论

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

评论(1

烟雨凡馨 2024-08-23 21:42:30

嗯,事实证明这只是 ILMerge 的一个命令行选项:

ILMerge.exe /out:MergedProjectDlls.dll
项目1.dll 项目2.dll 项目3.dll
Project4.dll /ndebug /xmldocs

Der, it turns out that's just a command-line option to ILMerge:

ILMerge.exe /out:MergedProjectDlls.dll
Project1.dll Project2.dll Project3.dll
Project4.dll /ndebug /xmldocs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文