Home > front end >  Browsing API documentation in Visual Studio. How?
Browsing API documentation in Visual Studio. How?

Time:01-16

Coming from Java world and now learning .NET 7 development in addition, I'm embarrassed to say, I cannot figure out how to open/view relevant API Reference documentation from within the IDE.

  • When I right-click a Dependency (Package) in Solution Explorer, I would expect an option to open the documentation which accompanies the given NuGet package. In short: How to open this documentation? (i.e. not for a specific class, but for a package as a whole)

  • When I right-click a namespace in say a using Foo.Bar directive in the code editor, I would expect an option to open the documentation for Foo.Bar (show of classes, etc). I cannot find such an option.

  • If I hover over a class name or right-click a class I would expect an option to display documentation for that class (its description, which methods does it have?, which properties? .. and so on).

I understand as much as that the equivalent of JavaDoc is some XML stuff which is typically bundled with each NuGet package. It is basically this that I would like to browse in HTML form. Or some other form which provides me an overview of which classes and interfaces exists, their methods, cross refs, and so on.

I'm aware of the F1 option in the code editor. However, it only works for stuff which is from Microsoft (it does an MSDN search).

For all the packages I use, I can see the XML file exist on disk, so for sure it is there.

I use various third-party libraries and some of them are kind enough to publish API Reference documentation on their website .. if you can find it. It all looks slightly different in terms of skin (I can live with that), but there doesn't seem to be a convention for how this documentation is made available to the library user as I'm used to in Java world. So I need to hunt for it?

Please help a newbie.

IDE: Visual Studio CE

Language: .NET 7

CodePudding user response:

I can see that this would be helpful, but what you are looking for doesn't exist. There's no centralized location for the documentation of non-microsoft packages. So if you want an overview over the classes of such a package, it's best to google for it (or visit the project's github page).

There are several ways to get to the information you want/need:

  • If you want to know the methods/properties of a class, just type a dot after an instance of the class to see the possible elements in a menu. If documentation exists, the description of the different methods will also be shown, together with the required parameters.

  • If you want to know about all the classes in a namespace, you can do the same, just explicitly type the namespace to get the list of classes.

  • Of course, you can also use a tool such as Ildasm or jetbrains dotPeek to get the class structure of an assembly/nuget package.

None of this is really a HTML documentation, but as said, that only exists if the package providers generate and provide it.

  • Related