Search code examples
c#visual-studiovisual-studio-2022xml-documentation

Is it possible to define links to other files in Visual Studio?


I have a class FooViewData.cs that serves as a ViewModel for a Foo.cshtml. It's also related tangentially to a foo.sql, foo.css, foo.js, etc...

When I am inside FooViewData.cs, I'd like to be able to click a link and jump to foo.js for instance.

I see that XML comments support tags like <see cref=".."/>, so I tried setting as <see cref="..\wwwroot\js\foo.js"/>, but Visual Studio doesn't appear to do anything about it.

Does Visual Studio have a feature that allows you to link from file to file?


Solution

  • No, unfortunately.

    It is possible to put an href in there, if you want to reference a URL for people to open in a browser:

    /// <see href="https://stackoverflow.com/q/75762355/120955" />
    

    But if you try putting local file names and such in the href, it doesn't open the file when you click through to the link. Nor does it update the comment if you rename the file.