سؤال

I have many multi-line style comments in a C# project and when the project option is set to output a XML documentation file they all trigger the warning XML comment is not placed on a valid language element. This behaviour is observed in Visual Studio 2010.

Short of changing all these comments to single-line style comments what can I do to prevent these warnings from being triggered?

Reduced example:

public class Foo
{
    /// <summary>
    /// Does something.
    /// </summary>
    public void DoSomething()
    {
        /**
         * Do something interest here.
         */
    }
}
هل كانت مفيدة؟

المحلول

Just remove the second * on the first line of the comment.

C-style XML doc comments are opened with /**.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top