In C# I have written an XML comment for the main
method:
/// <summary>
/// Some comment.
/// </summary>
public static void Main(string[] args)
{
But Visual Studio warns me against it:
XML comment is not placed on a valid language element main
What is the recommended way to comment on the main
method in C#?
Certain language elements aren't allowed to have xml documentation such as Namespaces and obviously in this case main methods also. The Documentation says this and also has some links that show other XML do's and don'ts.
The only hacky answer I could possibly suggest is if you wanted to comment it just use double quotes // instead of triples. The triples are processed into documentation for the class and is likely causing background issues.