Comments in C#

From the C# Programming Language cheat sheet · Getting Started · verified Jul 2026

Comments

Code documentation

csharp
// Single line comment

/* Multi-line
   comment block */

/// <summary>
/// XML documentation comment
/// </summary>

// TODO: Remember to implement this
// HACK: Temporary fix - refactor later
// NOTE: Important information
💡 Use /// for IntelliSense documentation
⚡ Regions help organize large files
📌 TODO comments are tracked by Visual Studio
🟢 XML comments generate documentation files

More C# tasks

Back to the full C# Programming Language cheat sheet