是否可以将 XML 注释添加到方法中,以允许其他程序员通过在工具提示中单击该 URL 来跟踪该 URL?
我尝试使用以下格式向方法添加 URL(我也尝试使用 see 和 see also 标签):
/// <summary>
/// Loads some data.
/// <a href="http://stackoverflow.com/">click me</a>
/// </summary>
/// <param name="id">The id.</param>
/// <returns>Some Data</returns>
private string LoadData(int id)
这会生成指向 URL 的可点击超链接,但是这仅在查看原始源代码时有效。如果可能的话,我希望能够在将鼠标悬停在对方法的调用上而不是方法本身上时单击并跟随工具提示中显示的超链接。
最佳答案
If possible I would like to the ability to click and follow the hyper link in the tool tip shown when hovering over a call to the method, rather than the method itself.
如果我理解你的问题是正确的,你会期待下图所示的内容
如果是,那么您的 Xml 注释是正确的,为了得到它,请将光标放在该方法上,然后按 Ctrl+Q 这是 Resharper 的缩写,以获取该方法的文档化帮助
更新:下图是确认 Ctrl+Q 是 ReSharper 快捷方式
关于c# - 将 URL 添加到 .NET XML 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12181273/