appsettings.json gets IntelliSense

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 production environment are stored in appsettings.production.json and the settings for 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 change logs for C# Extension 1.23.8

I tried it and it is very helpful.

Give it a try. I hope it helps.

3 thoughts on “appsettings.json gets IntelliSense

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s