2

So you know how your able to define a method comment such as

    /// <summary>
    /// Finds the site and information by site ID.
    /// </summary>
    /// <param name="siteID">The site ID.</param>
    /// <param name="customerLink">The customer link.</param>
    /// <returns></returns>
    public static Site FindSiteAndInformationBySiteID(int siteID, int customerLink)

Is there any way that you can retrieve this in code. By this I don't mean parsing the .cs file but actually getting it so I can use it. Something like

<method>.XMLComment

Thanks in advance!

1 Answer 1

6

Go into the project settings and in the Build tab, check the box for XML Documentation File. This will output all the XML comments to the XML file you specify. Then you can use whatever code method you would normally use to read in the XML.

Sign up to request clarification or add additional context in comments.

1 Comment

I agree with this solution. The reason why you need to do this is because XML comments are not written to the assembly (which is why reflection doesn't and can't offer the capability to access comments), therefore you need to tell the compiler to write them to a different file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.