按 ctrl+space 时 Visual Studio 显示文档

发布于 2024-11-17 22:07:00 字数 177 浏览 8 评论 0原文

由于某种原因,我只能看到 .net 库的文档。有没有办法在 Visual Studio 中查看我自己的或第三方的文档?

我想知道在 Visual Studio 2010 中按 ctrl+space 是否可以查看文档。与我在 Eclipse 中习惯的类似:)。或者至少在单击(选择)方法或类时能够在某种视图(窗口)中查看文档?

For some reason I can see docs only for .net libraries. Is there a way to see my own or third party docs in Visual studio?

I would like to know if its possible to see docs when pressing ctrl+space in Visual Studio 2010. Similar to what I'm used to in Eclipse :). Or at least when clicking (selecting) on method or class to be able to see docs in some kind of view (window)?

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

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

发布评论

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

评论(2

半葬歌 2024-11-24 22:07:00
  1. 通过在项目属性(“构建”选项卡)中启用适当的选项来生成 XML 文档

  2. 将生成的 XML 文件放在与DLL

  1. Generate XML documentation by enabling the appropriate option in project's properties (Build tab)

  2. Put resulting XML file in the same folder as the DLL

疑心病 2024-11-24 22:07:00

我认为“文档”是指智能感知工具提示吗?如果该方法存在 XML 文档,则此工具提示将包含该文档。 MSDN 上描述了 C# 中的 XML 文档。要向方法添加摘要文档,请添加前缀为 /// 的特殊注释:

public class Foo {

  /// <summary>
  ///   Bars the foo.
  /// </summary>
  public void Bar() {
  }

}

在 VB.Net 中,您可以使用相同的 XML,但必须使用 ''' 而不是 /// 作为特殊注释字符。

您必须使用 /doc 选项编译程序集。您可以在项目属性中启用它:

在项目属性中启用 XML 文档的生成

如果满足以下条件,生成的 XML 文件应遵循程序集:您将其复制到另一个位置。

By "docs" I assume you mean Intellisense tooltip? This tooltip will include XML documentation if that exists for the method. XML documentation in C# is described on MSDN. To add summary documentation to a method you add a special comment prefixed by ///:

public class Foo {

  /// <summary>
  ///   Bars the foo.
  /// </summary>
  public void Bar() {
  }

}

In VB.Net you can use the the same XML but will have to use ''' instead of /// as the special comment character.

You will have to compile the assembly using the /doc option. You can enable it in the project properties:

Enabling generation of XML documentation in project properties

The generated XML file should follow the assembly if you copy it to another location.

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