Expose Comments in C# DLL
Hey all,
I'm new enough to C# to not be an expert

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

Answers
- 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. 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
- 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. 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.
Thanks for the advice; I seemed to have sorted it but I'm not sure which one of the things resolved it

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!
- Reanaming the xml document to have the same name as project name
it works
thank u all - 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!


