PDA

Click to See Complete Forum and Search --> : [RESOLVED] Descriptions of Functions in Intellisense


Kasracer
Jan 5th, 2006, 06:23 AM
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.

crptcblade
Jan 5th, 2006, 06:36 AM
/// <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?

Kasracer
Jan 5th, 2006, 01:16 PM
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.

jmcilhinney
Jan 5th, 2006, 04:47 PM
All I did was add the XML comments, as crptblade suggested:

crptcblade
Jan 5th, 2006, 04:48 PM
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.

jmcilhinney
Jan 5th, 2006, 05:41 PM
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.

Kasracer
Jan 5th, 2006, 06:01 PM
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!