Ratstache
Ratstache

Reputation: 21

triple slash comments not working in namespace

I would like to know if there is a way to get the /// documentation comments to work within a namespace block. They work fine in every other situation, is there a reason they are disabled inside namespaces or is it a bug? I am working in Visual Studio 2013 coding in C#.

Thanks!

Upvotes: 1

Views: 1085

Answers (1)

Grant Winney
Grant Winney

Reputation: 66489

It's not a bug; it's unsupported by design. (As for the "why" behind the decision, I wouldn't know.)

From the notes on Compiler Warning (level 2) CS1587:

XML comment is not placed on a valid language element

Recommended tags for documentation comments are not allowed on all language elements. For example, a tag is not allowed on a namespace. For more information on XML comments, see Recommended Tags for Documentation Comments (C# Programming Guide).

There's even an example in that doc of exactly what you're trying to do.

(The doc says VS2008 at the top, but I verified I'm getting the same warning in VS2013.)

Upvotes: 2

Related Questions