Quick fix? In code, hit Ctrl + / (Windows) or Cmd + / (Mac) at the start of the line. In a URL or address field, it’s probably a separator—check for three-word location identifiers like what3words.
What’s Going On Here?
Outside code, three slashes can mark a what3words address—a system that splits the world into 3m x 3m squares, each labeled with three words. Rarely, you might see them in URLs or legacy systems, but that’s not the norm.
How Do I Fix or Add These Comments?
/// above a class, method, or property to auto-generate XML documentation.Here’s how to make it work:
- Open your C# project in Visual Studio 2022 (Version 17.8 or newer). Find the file where you want to add docs.
- Hover over a class, method, or property. Type
///and hit Enter. Visual Studio builds a template with<summary>and<returns>tags. - Fill in the blanks. For example:
<summary> Gets the full name of the user. </summary> <returns> A string with the first and last name. </returns>
- Save the file. Now your IDE tooltips and generated docs will show this text when you hover.
For what3words addresses:
- Go to map.what3words.com.
- Paste the three-word address (e.g.,
///house.bench.lamp). - If it’s valid, the map zooms to that exact spot. If not, you’ll get an error.
Why Didn’t This Work?
First, double-check you’re editing a .cs file—JavaScript and Python use different comment styles. Then, in Visual Studio, go to Tools > Options > Text Editor > C# > Advanced and make sure “Generate XML documentation comments for ///” is turned on.
For what3words:
- Look for typos—what3words uses periods, not spaces (e.g.,
house.bench.lamp). - Some apps add the
///for you, so try including it if it’s missing. - Run the address through the what3words validator to catch swapped words or wrong separators.
In URLs or plain text:
- If you see
///in a URL, it’s likely a typo—most servers readhttps://example.com, nothttps:///example.com. - In text files, triple slashes are usually mistakes. Swap them for spaces or a single slash if you’re using them as separators.
How Can I Avoid Issues Later?
For developers:
- Turn on CodeLens (under Tools > Options > Text Editor > All Languages > CodeLens) to preview docs inline.
- Use Git pre-commit hooks to flag public methods missing documentation.
For non-developers sharing what3words addresses:
- Stick to three words separated by periods (e.g.,
house.bench.lamp). - Skip extra slashes—the system expects exactly three words, no more.
- Always verify the address on the official map before sending it.
For general text editing:
- Use Find and Replace (Ctrl+H) to clean up extra slashes. Search for
///and swap it for a space or the separator you need.