Appsettings Analyzer analyzes appsettings.json in your .NET solution and shows which configuration keys are used in code, which are unused, and which are missing.
A Visual Studio extension that analyzes appsettings.json in .NET solutions and helps you see how configuration keys are used in code, which are unused, and which are missing from the config.
Features
Used / unused key highlighting
Keys that are referenced in code are highlighted in one style; keys that are never used are highlighted differently so you can clean up dead configuration.
Usage locations
For each key used in code, the extension finds where it is used (e.g. GetSection, Configure<TOptions>, IConfiguration["key"], GetValue<T>). You get:
Quick Info on hover: list of usages with clickable links to jump to the code.
CodeLens-style indicators next to each key (e.g. “3 usages” or “Not used”).
Missing settings
When the code references configuration keys that are not present in appsettings.json, the extension:
Shows a banner at the top of the editor (with space reserved so it doesn’t overlap the first line).
Offers a light-bulb suggestion (Ctrl+.) to add the missing keys.
Lets you add them in one click; the JSON is updated with default structure and values based on usage (e.g. options types).
Performance
For large solutions, analysis is limited to code reachable from Program.cs and Startup.cs (and the methods they call), so only the part of the solution where configuration is typically registered is scanned.
Roslyn-based analysis
C# files are analyzed using the Roslyn syntax tree (no regex on source), so detection of GetSection, Configure, config["key"], GetValue, and options binding is accurate and robust.