Results 1 to 7 of 7

Thread: [RESOLVED] Descriptions of Functions in Intellisense

  1. #1

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Resolved [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.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    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?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Descriptions of Functions in Intellisense

    All I did was add the XML comments, as crptblade suggested:
    Last edited by jmcilhinney; Feb 9th, 2008 at 03:47 AM.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    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.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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!
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width