Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make a docstring in VB.NET?

I'm writing a .dll in Visual Basic. When writing code in Visual Studio if I do something like

Console.WriteLine(

it will pop up a tooltip with a bit of documentation for the function. Is it possible to write something in my function/sub that would provide that information to Visual Studio?

Thanks

like image 857
Wayne Werner Avatar asked Jan 23 '23 01:01

Wayne Werner


1 Answers

Yeah, sure! Something like:

''' <summary>
''' Comment for method
''' </summary>
''' <param name="Parameter">Comment for the parameter "Parameter"</param>
''' <remarks></remarks>
Sub Test(ByVal Parameter As Integer)

End Sub

The XML documentatin block should be prepended with three comment (single quote) characters.

You can view a list of common documentation XML tags here.

Bonus point is that the compiler can extract an XML file and put it alongside your assembly which documentation generator tools (like Sandcastle, NDoc) can use to generate formatted help files with your API documentation automatically.

like image 127
mmx Avatar answered Jan 24 '23 14:01

mmx