Skip to content

Commit 1b2220d

Browse files
authored
Silencing JSON comment errors (#34825)
1 parent 6db268c commit 1b2220d

File tree

1 file changed

+10
-0
lines changed
  • aspnetcore/fundamentals/configuration

1 file changed

+10
-0
lines changed

aspnetcore/fundamentals/configuration/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ Using the [default](#default) configuration, the `appsettings.json` and `appsett
138138

139139
Comments in `appsettings.json` and `appsettings.{Environment}.json` files are supported using JavaScript or [C# style comments](/dotnet/csharp/language-reference/tokens/comments).
140140

141+
Some integrated development environments (IDE) display errors when editing a JSON file that contains comments. You can generally ignore comment errors and warnings, but you can also usually disable them with a setting in the IDE. In Visual Studio Code, for example, add the following to the `settings.json` file to disable the errors:
142+
143+
```json
144+
"files.associations": {
145+
"appsettings*.json": "jsonc"
146+
}
147+
```
148+
149+
For other IDEs, check the tool's documentation and other product support channels to determine how to silence the errors.
150+
141151
<a name="optpat"></a>
142152

143153
### Bind hierarchical configuration data using the options pattern

0 commit comments

Comments
 (0)