8

Is there a tag for a file reference in a xml code comment? The file is a sql script file. Just wondering if there is a better way than something like this

///<summary>
///please have a look at c:\code\project1\sql\file1.sql
///</summary> 
1
  • Do you use these xml comments to generate a html helpfile with sandcastle or something? Commented Mar 23, 2011 at 10:49

4 Answers 4

7

You could use a file URI, this makes it clickable in visual studio:

file:///c:/code/project1/sql/file1.sql
Sign up to request clarification or add additional context in comments.

4 Comments

thanks. is it possible to have a relative path? file://..\..\..\file.sql That doesn't seem to work
@JML - Yes, that would be (assuming your file is "c:\code\project\code\source.cs") "file:../sql/file1.sql"
- sadly, that doesn't work, ive tried /// file:../../Database/EmployeeUploadFileConfiguration_TestDataForFormulaValidation.sql and even tested with a reference to another file in the same folder: /// file://EligibilityCriteriaFormulaTests.cs shame because that would be quite helpful for comments. intellisense link doesn't work
Oh I'm sorry, it seems to be relative to the devenv.exe (visual studio executable) location. I'm not sure how I missed that :-s. So it only works for absolute paths.
7

You can mix in elements from other namespaces, including xhtml, so

///<summary>
///please have a look at <a href="file:///c:/code/project1/sql/file1.sql">file:///c:/code/project1/sql/file1.sql</a>.
///</summary>

Is allowed, though whether it's made use of well or not depends on what you use to turn the XML into something more readable. Tooltip-use at least in my IDE ignores the tag and displays the text inside (which is what I'd want in a tool-tip).

Of course, it's not much use on a machine that doesn't have the correct c:\code\project1\sql\file1.sql

Comments

1

The most commonly used tags are listed at http://msdn.microsoft.com/en-us/library/5ast78ax(v=vs.71).aspx. It also mentions that it will process "any tag that is valid XML" so you aren't limited to these.

Comments

0

There is such a things like special tag for file reference in XML. It is meta language without such limitations.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.