문제

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