[RESOLVED] Descriptions of Functions in Intellisense
I know to use [Description()] to create a description for a property. That shows up in the Properties in the Designer.
How do I create a description of a function? i.e. when you start to type in my function, it'll say what it does and it'll also tell you what each value passed to the function means.
I used to know this but I can't remember.
Running VS2003, btw.
Re: Descriptions of Functions in Intellisense
Code:
/// <summary>
/// This is the description of my function
/// <param name="myString">The string you want to do something with.</param>
/// </summary>
private void myFunction(string myString) {
MessageBox.Show(myString);
Is that what you're after?
Re: Descriptions of Functions in Intellisense
Well, I tried building my DLL. Then referencing it in a test project and it still doesn't show the summary in the intellisense.
Is there something I'm missing?
Like if I type the following
System.Math.Round
It shows me the following text:
Returns the number with the specified precision nearest the specified value
When I type System.Math.Round(, it'll start showing me a little description of each variable I need to pass to the Round() method.
That is what I want my methods to do, however; even with the summary they still do not do it.
Re: Descriptions of Functions in Intellisense
All I did was add the XML comments, as crptblade suggested:
Re: Descriptions of Functions in Intellisense
Oops, forgot the important part. Go to your project's properties, under Configuration Properties->Build, and in the XML Documentation File field, put in <Assembly Name>.xml
Rebuild your project and the xml file should be generated. Then the project you reference your DLL from should pick up the documentation, after you reopen the project of course.
Re: Descriptions of Functions in Intellisense
Hmmm... mustn't ever have tried to use XML comments from a C# DLL before as I didn't know that myself. Obviously my previous test didn't take into account the seperate projects. Sorry for the red herring.
Re: Descriptions of Functions in Intellisense
Quote:
Originally Posted by crptcblade
Oops, forgot the important part. Go to your project's properties, under Configuration Properties->Build, and in the XML Documentation File field, put in <Assembly Name>.xml
Rebuild your project and the xml file should be generated. Then the project you reference your DLL from should pick up the documentation, after you reopen the project of course.
Thanks. Works perfectly!