Adding a URL to .NET XML Comments

Can I add XML comments to a method that allows other programmers to follow the URL by clicking on it in the tooltip?

I tried to add the method URL using the following format (I also tried using the see and see tags as well):

/// <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) 

This creates a clickable URL hyperlink, however this only works when looking at the source code. If possible, I would like to click and follow the hyperlink in the tooltip displayed when you hover over the method call, and not on the method itself.

+2
source share
2 answers

If possible, I would like to click and follow the hyperlink in the tooltip shown when you hover over a method call, not the method itself.

If I understand the question correctly, you expect something like the one shown in the image below enter image description here

If yes, then your Xml comments are correct, and in order for this to place the cursor over the method and Ctrl + Q, this is a shortcut from Resharper to get the documented help of the method

Update: below image for confirmation Ctrl + Q is ReSharper shortcut enter image description here

+1
source

Without a fancy tool like Resharper, tool tips are not clickable, so there is no way to do this.

However, if the programmer linking to your library had to click Go to Definition for your code, they could expand the comment there and click on the URL.

0
source

Source: https://habr.com/ru/post/1205809/


All Articles