ConfigGenerator 1.0.4

dotnet add package ConfigGenerator --version 1.0.4
                    
NuGet\Install-Package ConfigGenerator -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConfigGenerator" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConfigGenerator" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="ConfigGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ConfigGenerator --version 1.0.4
                    
#r "nuget: ConfigGenerator, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ConfigGenerator@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ConfigGenerator&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=ConfigGenerator&version=1.0.4
                    
Install as a Cake Tool

Source Generator for generating POCO classes based on your appsettings.json files

NuGet Badge

This Source Generator generates POCO's based on your appsettings.json files. It also supports multiple settings files: appsettings.json + appsettings.Development.json + appsettings.Production.json, etc.

  1. Add the appsettings.json files to your .csproj like this:
  <ItemGroup>
    <AdditionalFiles Include="appsettings.json" />
    <AdditionalFiles Include="appsettings.Development.json" />
  </ItemGroup>

You can add as many appsettings files as you want 😃

  1. The config classes are generated in the namespace ApplicationConfig (This will be configurable in the next release).
  2. Register your config in the DI container: builder.Services.Configure<ApplicationConfig.MyAppConfig>(builder.Configuration);
  3. Inject the config in your constructor: IOptions<ApplicationConfig.MyAppConfig> options

⚠️ You may have to restart Visual Studio after installing this NuGet package!

See this blogpost for more information:

https://albertromkes.com/2020/11/04/a-source-generator-for-your-appsettings-json/

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 469 11/23/2022
1.0.3 353 11/20/2022