Ask a questionAsk a question
 

AnswerExpose Comments in C# DLL

  • Wednesday, May 07, 2008 4:26 PMLdwater Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hey all,

     

    I'm new enough to C# to not be an expert Stick out tongue

     

    Anyway, i'm writting a DLL to integrate with another piece of software, a DLL that will be used by other developers / customers.

     

    Since this is the case I was using the summary function (/// <Summary>...) to write comments on the methods etc.

     

    The intelisence seems to pick it up fine within the scope of the project, but when I reference the DLL in another project all the comments are gone?

     

    I have selected the 'XML Documentation File' option which seems to generate the comments into an XML file for me; great, but it still doesn't seem to expose the comments.

     

    I have written an interface class and another class that implments it; am I supposed to put the comments on the interface class / methods (which doesn't seem to work) or am I missing some hidden option that exposes these comments when compiled.

     

    Thanks in advance!

     

    PS: FYI I am using C# express 2008 incase its some sort of shortfall in the express version Stick out tongue

Answers

  • Wednesday, May 07, 2008 6:50 PMKea Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Make sure the XML doc file option is checked for the build configuration you're using. If you checked it in Debug config, and use a Release build when referencing the dll in other projects the option was unchecked.
    If the produced XML file is located together with the dll, the IDE usually figures it out when you reference it.
  • Wednesday, May 07, 2008 11:41 PMAlex Cater Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
     Ldwater wrote:

    I have written an interface class and another class that implments it; am I supposed to put the comments on the interface class / methods (which doesn't seem to work) or am I missing some hidden option that exposes these comments when compiled.

     

    I suggest that you comment both the class and the interface. The comments displayed in intellisense will depend on the context. e.g. if you are invoking a method on an interface reference then the interface comment will be visible and vice versa.

     

    In addition, you should consider compiling your XML docs into help files using tools like Sandcastle or NDoc.

All Replies

  • Wednesday, May 07, 2008 6:50 PMKea Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Make sure the XML doc file option is checked for the build configuration you're using. If you checked it in Debug config, and use a Release build when referencing the dll in other projects the option was unchecked.
    If the produced XML file is located together with the dll, the IDE usually figures it out when you reference it.
  • Wednesday, May 07, 2008 11:41 PMAlex Cater Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
     Ldwater wrote:

    I have written an interface class and another class that implments it; am I supposed to put the comments on the interface class / methods (which doesn't seem to work) or am I missing some hidden option that exposes these comments when compiled.

     

    I suggest that you comment both the class and the interface. The comments displayed in intellisense will depend on the context. e.g. if you are invoking a method on an interface reference then the interface comment will be visible and vice versa.

     

    In addition, you should consider compiling your XML docs into help files using tools like Sandcastle or NDoc.

  • Thursday, May 08, 2008 4:10 PMLdwater Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Thanks for the advice; I seemed to have sorted it but I'm not sure which one of the things resolved it Stick out tongue

     

    1) I added comments to all of the items in the interface class

    2) I added comments to some elements that needed comments

    3) I renamed the XML document to have the same name as the project itself.

     

    Either way it worked, thanks!

  • Monday, August 03, 2009 8:49 AMsukki07 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Reanaming the xml document to have the same name as project name
    it  works
    thank u all
  • Monday, November 02, 2009 1:24 AMAidan Follestad Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you all! I've been trying to figure out this problem for months, and just gave up. Changing the name of the XML doc file to the exact name of the project fixes it!

    C# FOREVER!