As announced by Microsoft recently, we can use IntelliSense with appsettings.json files.

What Are appsettings.json Files?

Common settings of the application are generally stored in appsetting.json files. These files are separated on the basis of environments.

For example, the settings for the production environment are stored in appsettings.production.json and the settings for the acceptance environment are stored in appsettings.acceptance.json. Basically appsettings.{environment}.json.

These files are used generally to store connection strings for the database, any application scope global variables, logging, host filtering, HTTPS certificates, Kestrel endpoints, etc.

How to Use IntelliSense With appsettings.json?

Visual Studio and Visual Studio Code now support IntelliSense for appsettings.json files. For Visual Studio Code, the support comes with C# extension version 1.23.8 or later.

This comes along with the schema addition for appsettings files. It can be seen in the changelogs for C# Extension 1.23.8:

C# Changelogs

I tried it and it is very helpful.

Action Screenshot

Give it a try. I hope it helps!

Source link

Write A Comment