Configo.Tool
1.1.3
dotnet tool install --global Configo.Tool --version 1.1.3
dotnet new tool-manifest
dotnet tool install --local Configo.Tool --version 1.1.3
#tool dotnet:?package=Configo.Tool&version=1.1.3
nuke :add-package Configo.Tool --version 1.1.3
Configo.Tool
The Configo CLI tool, distributed as a .NET tool.
It generates an appsettings.schema.json file for your application by introspecting its dependency injection container, giving you IntelliSense and validation for your configuration in editors that support JSON schema.
Installation
Install globally:
dotnet tool install --global Configo.Tool
Or as a local tool (recommended for repeatable builds):
dotnet new tool-manifest # if you don't have one yet
dotnet tool install Configo.Tool
Usage
Run from your application's directory:
configo schema generate
configo schema generate --project src/MyApp
configo schema generate --project src/MyApp/MyApp.csproj --output ./appsettings.schema.json
| Option | Description |
|---|---|
--project <path> |
Path to the .csproj file or the directory that contains it. Defaults to the current working directory. |
--output <file> |
Output path for the generated schema file. Overrides the default location. Can be absolute or relative to the current directory. |
--help, -h |
Show the help message. |
How it works
The tool launches your application out-of-process with schema generation enabled. Your app must reference the Configo.Design package and call AddConfigoDesign() so the tool can discover which CLR types are bound to which configuration sections. Your app writes a small bindings manifest and exits.
The tool then generates a small throwaway project in a temporary directory that:
- targets your application's runtime,
- references your application's compiled output,
- declares a
FrameworkReferencetoMicrosoft.AspNetCore.App, and - references the
Configo.Design.Generationpackage.
It runs that throwaway project to produce the schema, then deletes it. Because generation runs on your application's own runtime — compiled against your app and the ASP.NET Core shared framework — the .NET host resolves your application's full dependency closure, including shared-framework types such as System.Threading.RateLimiting, exactly as it does when your app runs. The tool itself never loads your application's assemblies, which avoids the DLL-resolution failures that come from loading another app's assemblies into a different runtime.
NJsonSchema therefore lives only in Configo.Design.Generation (used by the throwaway project) and never ships in your application.
Descriptions come from XML documentation. Enable
<GenerateDocumentationFile>true</GenerateDocumentationFile>in your application project so your<summary>comments become schemadescriptions.
Supported runtimes. Schema generation currently supports net10.0 applications. If your app targets a different runtime, the tool fails fast with a clear message; support for more runtimes is planned.
The generated schema is written as UTF-8 without a byte-order mark, so editors such as VS Code consume it correctly.
The bindings manifest — not the application's process exit code — is the real success signal. If your host exits non-zero while shutting down mid-startup (for example, Kestrel rethrowing a cancellation from BindAsync) but a fresh manifest was written, the tool proceeds and prints a warning. See the Configo.Design documentation for how to make the design-time shutdown non-fatal.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.