The appsettings.json
file is a common way to configure .NET apps. ASP.NET Core uses appsettings.json
and appsettings.${Environment}.json
files to configure some of its most frequently used features, including:
- Database connection strings
- Kestrel endpoints
- HTTPS certificates
- Logging
- Host filtering
Visual Studio and Visual Studio Code (with C# extension 1.23.8 or later) now support IntelliSense of well known appsettings.json
configuration settings. IntelliSense allows you to quickly edit your app’s configuration and get immediate feedback on available properties or typos.
IntelliSense for appsettings.json
in action:
There isn’t anything you need to do to enable this feature. Try it out today! Happy coding.
What about Azure Functions? LocalSettings.json
It’s there too: https://json.schemastore.org/local.settings.json
Hi James,
Awesome feature!
Is there a way to expand the supported features ?
Br,
Adrien C.
That's a great start.
Given that many applications store many of their own settings in the app settings file it'd be great if the schema could be open source so that it could be used as the basis for our custom files.
I've written (or generated) my own schema files in the past that only included the most important settings that I was aware of and having a complete up to date file would be tremendously useful.
It’s open-source 👍 https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/appsettings.json You can create a fork of that repo and change the schema file inside Visual Studio to point towards your own file like seen here: https://elmah.io/tools/appsettings-validator/ (scroll to the What can it do? section)
This is a great addition! Are json schemas behind this feature perhaps?
Yes. The settings and descriptions use a schema from https://www.schemastore.org/json/. We updated it with the most commonly used settings.