Configo.Design
1.1.0
See the version list below for details.
dotnet add package Configo.Design --version 1.1.0
NuGet\Install-Package Configo.Design -Version 1.1.0
<PackageReference Include="Configo.Design" Version="1.1.0" />
<PackageVersion Include="Configo.Design" Version="1.1.0" />
<PackageReference Include="Configo.Design" />
paket add Configo.Design --version 1.1.0
#r "nuget: Configo.Design, 1.1.0"
#:package Configo.Design@1.1.0
#addin nuget:?package=Configo.Design&version=1.1.0
#tool nuget:?package=Configo.Design&version=1.1.0
Configo.Design
Design-time support for Configo.
This package enables the configo schema generate dotnet tool to introspect your application's DI container and produce an appsettings.schema.json file with accurate JSON schema definitions for all your configuration sections.
How it works
Configo.Design registers a hosted service that is a no-op during normal application startups. It only activates when the application is launched by the configo schema generate tool (i.e., when the CONFIGO_GENERATING_SCHEMA=true environment variable is set).
When activated, the service discovers all bound configuration sections and writes a lightweight bindings manifest (a temp JSON file) that tells the tool which CLR types are bound to which configuration section names. It then stops the application. The tool reads this manifest, loads the application's compiled assemblies, and generates the full JSON schema using NJsonSchema — entirely within the tool process. The application itself never references NJsonSchema.
Installation
<PackageReference Include="Configo.Design">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Why
PrivateAssets=all? This is a design-time dependency — it is only needed when running theconfigo schema generatetool, not during normal application execution. UsingPrivateAssets=allpreventsConfigo.Designfrom flowing transitively to any project that references yours as a library.
Usage
In your Program.cs, register the schema generator alongside your other services:
// This is a no-op unless run under `configo schema generate`.
builder.Services.AddConfigoDesign();
Then run the tool from your project directory:
dotnet configo schema generate
dotnet configo schema generate --output ./appsettings.schema.json
Skipping database migrations during schema generation
When running under the tool, you may want to skip startup work (like EF Core migrations) that requires a live database. Use ConfigoDesignEnvironment.IsActive to guard it:
if (!ConfigoDesignEnvironment.IsActive)
{
await app.Services.MigrateAsync();
}
| 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. |
-
net10.0
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Logging (>= 10.0.9)
- Microsoft.Extensions.Options (>= 10.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.