0

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.
         */
    }
}
1
  • 1
    Something to do with the double star? That's like a doc-comment in Java... change it to /* instead of /** Commented Feb 15, 2013 at 16:58

1 Answer 1

10

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

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

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

1 Comment

I see, only /** triggers the warning, any other amount of * in the first line does not trigger the warning. Thanks @SLaks and @applechewer.

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.