aemarcoToolboxAppOptions 9.0.37

dotnet add package aemarcoToolboxAppOptions --version 9.0.37
                    
NuGet\Install-Package aemarcoToolboxAppOptions -Version 9.0.37
                    
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="aemarcoToolboxAppOptions" Version="9.0.37" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="aemarcoToolboxAppOptions" Version="9.0.37" />
                    
Directory.Packages.props
<PackageReference Include="aemarcoToolboxAppOptions" />
                    
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 aemarcoToolboxAppOptions --version 9.0.37
                    
#r "nuget: aemarcoToolboxAppOptions, 9.0.37"
                    
#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 aemarcoToolboxAppOptions@9.0.37
                    
#: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=aemarcoToolboxAppOptions&version=9.0.37
                    
Install as a Cake Addin
#tool nuget:?package=aemarcoToolboxAppOptions&version=9.0.37
                    
Install as a Cake Tool

aemarcoToolboxAppOptions

<a href=https://www.nuget.org/packages/aemarcoToolboxAppOptions><img src="https://buildstats.info/nuget/aemarcoToolboxAppOptions"></a><br/>

Overview

This package provides a opinionated approach to the Options pattern described in the Microsoft docs. With minimal setup, all the Option classes will be registered in the IOC container and mapped to the IConfiguration source.

  • Automatic mapping of sections to classes (convention driven, but can be adjusted)
  • Beside registering the interfaces from Microsoft, registers the class itself as well (singleton)
  • Registers also interfaces which you put on the settings class
  • Allows text transformations between IConfiguration and the settings class
  • Option to use fluent validation on settings
  • Option to validate settings during startup (on by default, opt-out in options)

Get Started

During startup of the app

{
  services.AddConfigOptionsUtils(config);
}

Create your class representing your options

{
  public class MySettings : ISettingsBase
  {
    public string? Text { get; set; }
    public bool Enable { get; set; }
  }
}

In appsetting.json (or other IConfiguration source)

{
    "MySettings": {
        
        "Text": "SomeText",
        "Enable": true
    }
}

StringTransformation

String transformations will be executed in the order defined in the setup process. You could define your own, but PlaceholderTransformation is built in already.

{
    services.AddConfigOptionsUtils(
        config,
        x => x
            .AddStringTransformation(new PlaceholderTransformation());
}

PlaceholderTransformation does resolve placeholders {{{...}}} through the entire IConfguration by Key. That maybe usefull when piecing together file or url path.

{
    "Message": "Hello world!",
    "MySettings": {
        
        "Text": "The message is {{{Message}}}",
        "Enable": true
    }
}

Fluent Validation

Just define your Validators in the assemblies where setting classes are defined. The tool will register them, and use them if present. By default, Validation takes place at startup.

{
    services.AddConfigOptionsUtils(
        config,
        x => x
            .EnableValidationOnStartup(false); //on by default
}

Setting classes in multiple assemblies

The tool relies on assembly scanning during the setup. If your option classes are in other assemblies, you may pass one of the types as assembly marker, and/or use the assemblies itself.

{
    services.AddConfigOptionsUtils(
        config,
        x => x
            .AddAssemblyMarker(typeof(MySettings))
            // and/or
            .AddAssemblies(someAssemblies));
}

Mapping Path

By default, the class name is exactly matched to the root level of the configuration. You may define your own path in the settings class

{
  [SettingsPath("Settings")]
  public class MySettings : ISettingsBase
  {
    public string? Text { get; set; }
    public bool Enable { get; set; }
  }
}

would map to

{
    "Settings": {
        
        "Text": "SomeText",
        "Enable": true
    }
}

You could even do it nested, just use the colon seperated path as you would with GetSection().

{
  [SettingsPath("Settings:Nested")]
  public class MySettings : ISettingsBase
  {
    public string? Text { get; set; }
    public bool Enable { get; set; }
  }
}

would map to

{
    "Settings": {
        "Nested":{
            "Text": "SomeText",
            "Enable": true
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
9.0.37 207 9/14/2025
9.0.33 123 9/13/2025
9.0.31 131 9/13/2025
9.0.30 116 9/13/2025
9.0.6 133 9/13/2025
9.0.5 125 9/13/2025
9.0.4 123 9/13/2025
9.0.3 132 9/13/2025
8.4.13 145 9/11/2025
8.4.12 178 8/30/2025
8.4.11 235 8/6/2025
8.4.10 55 8/2/2025
8.4.9 51 8/1/2025
8.4.6 127 7/27/2025
8.4.5 145 6/20/2025
8.4.4 124 5/3/2025
8.4.3 108 4/26/2025
8.4.2 123 4/25/2025
8.4.1 193 4/20/2025
8.3.2 199 4/20/2025
8.2.11 205 4/20/2025
8.2.10 230 4/13/2025
8.2.9 200 4/6/2025
8.2.8 195 3/30/2025
8.2.7 300 3/23/2025
8.2.6 166 3/16/2025
8.2.5 156 3/2/2025
8.2.4 161 1/26/2025
8.2.3 133 1/9/2025
8.2.2 233 1/9/2025
8.1.4 158 1/1/2025
8.1.3 156 12/31/2024
8.1.2 147 12/26/2024
8.0.8 141 12/23/2024
8.0.7 146 12/23/2024
8.0.6 141 12/22/2024
8.0.5 129 12/21/2024
8.0.4 140 11/17/2024
8.0.3 170 11/17/2024
5.0.21 151 11/16/2024
5.0.20 161 10/20/2024
5.0.19 159 10/19/2024
5.0.18 176 10/19/2024
5.0.17 168 10/13/2024
5.0.16 143 10/12/2024
5.0.6 140 10/6/2024
5.0.5 156 10/2/2024
5.0.4 144 10/1/2024
5.0.3 153 9/22/2024
5.0.2 248 9/16/2024
4.0.9 165 9/15/2024
4.0.8 154 9/8/2024
4.0.7 140 9/8/2024
4.0.6 140 9/8/2024
4.0.5 132 9/8/2024
4.0.2 166 9/8/2024
3.1.27 157 9/8/2024
3.1.26 162 9/7/2024
3.1.25 178 9/7/2024
3.1.24 160 9/7/2024
3.1.23 160 9/1/2024
3.1.22 156 9/1/2024
3.1.21 176 6/16/2024
3.1.20 148 5/31/2024
3.1.19 130 5/20/2024
3.1.18 153 5/10/2024
3.1.17 178 4/12/2024
3.1.16 178 4/4/2024
3.1.15 187 3/22/2024
3.1.11 178 3/19/2024
3.1.10 188 2/16/2024
3.1.7 202 2/11/2024
3.1.6 189 2/11/2024
3.1.5 180 2/11/2024
3.1.4 170 2/11/2024
3.0.18 235 1/29/2024
3.0.17 161 1/29/2024
3.0.16 162 1/27/2024
3.0.15 159 1/27/2024
3.0.8 173 1/27/2024
3.0.7 222 1/13/2024
2.0.18 241 1/4/2024
2.0.17 254 1/1/2024
2.0.16 253 12/27/2023
2.0.15 234 12/26/2023
2.0.14 235 12/26/2023
2.0.13 216 12/25/2023
2.0.11 198 12/23/2023
2.0.10 261 12/16/2023
2.0.9 229 12/15/2023
2.0.8 240 12/14/2023
2.0.7 259 12/13/2023
2.0.5 242 12/11/2023
2.0.4 248 12/11/2023
2.0.2 265 12/10/2023
1.9.2 250 12/10/2023
1.8.4 271 12/10/2023
1.8.3 288 12/9/2023
1.8.2 268 12/9/2023
1.1.28 284 11/27/2023
1.1.27 239 11/26/2023
1.1.26 260 11/18/2023
1.1.25 257 11/17/2023
1.1.24 301 10/30/2023
1.1.23 270 10/29/2023
1.1.22 266 10/22/2023
1.1.21 299 10/17/2023
1.1.20 310 9/16/2023
1.1.19 388 8/27/2023
1.1.18 324 7/31/2023
1.1.17 369 7/16/2023
1.1.16 337 7/9/2023
1.1.15 363 7/8/2023
1.1.14 375 7/5/2023
1.1.13 318 6/29/2023
1.1.12 356 5/1/2023
1.1.11 527 3/5/2023
1.1.10 476 3/3/2023
1.1.9 503 2/28/2023
1.1.7 531 2/26/2023
1.1.6 500 2/26/2023
1.1.5 355 2/26/2023
1.1.3 345 2/25/2023