Andrey Bushman
Andrey Bushman

Reputation: 12516

Can I add the web-link into the XML-documentation?

Here I see the set of the allowed XML-tags for generation of the documentation (through SandCastle).

Wether exists the additional XML-tag for the link (to web-page) which would be opened through the browser when user press it? If I use <a href="...:/> then CHM-file attempts to open the link in its window and I get the script error message.

Upvotes: 1

Views: 2592

Answers (2)

Paul Nakitare
Paul Nakitare

Reputation: 222

This worked for me:

/// <summary>
/// A good example <see href="https://example.com"/>.
/// </summary>

Upvotes: 0

From the MSDN forum post "Embedding External URLs or Hyperlinks within XML Comments":

"To insert an external hyperlink, do just as you do in an html file. For example in your scenario, you can add the credit like this:"

/// <summary>
/// This is a test class.See <a href="http://…">Credits</a>.
/// </summary>

"And a help documentation tool such as SandCastle will process it properly."

— user Chunsheng Tang

So using <a> generally seems like the right way to go.

Unfortunately, you did not say exactly what kind of script error message you're getting.

  • The opened web page might simply contain errors itself. If that is the case, there is not much you can do except linking to a different web page.

  • The help viewer might open the web page inside its own browser, where script execution is restricted. In this case, you could try adding a target="_blank" attribute to the <a> element, so that the web page will be opened in a new window or tab.

Upvotes: 1

Related Questions