Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Appsettings Analyzer
Appsettings Analyzer

Appsettings Analyzer

Anton Stepanov

|
6 installs
| (0) | Free
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.
Download

Appsettings Analyzer

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.

Supported patterns

  • IConfiguration["key"], Configuration["key"], config.GetSection("Section"), chained GetSection, nameof(Section).
  • Configure<TOptions>(configuration.GetSection("Section")) and options type property mapping.
  • GetSection("Section").Get<TOptions>().
  • GetValue<T>("key") and indexer access on configuration/section variables.
  • Nested keys (e.g. Section:SubSection:Key) and mapping from options classes (including [ConfigurationKeyName]).

Requirements

  • Visual Studio 2022 (17.x) or compatible version.
  • .NET projects that use appsettings.json (e.g. ASP.NET Core, generic host).

Usage

  1. Open a solution and open (or create) an appsettings.json file in the project.
  2. The extension runs analysis when the file is opened and when you edit it (with a short delay).
  3. Use the colors and CodeLens indicators to see used vs unused keys.
  4. Hover over a key to see usage locations; click a link to go to the code.
  5. If there are missing keys, use the top banner or the light bulb (Ctrl+.) to add them to appsettings.json.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft