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开发者_Python百科/sub that would provide that information to Visual Studio?
Thanks
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.
精彩评论