aemarcoToolboxAppOptions 9.0.33

There is a newer version of this package available.
See the version list below for details.
dotnet add package aemarcoToolboxAppOptions --version 9.0.33
                    
NuGet\Install-Package aemarcoToolboxAppOptions -Version 9.0.33
                    
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.33" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="aemarcoToolboxAppOptions" Version="9.0.33" />
                    
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.33
                    
#r "nuget: aemarcoToolboxAppOptions, 9.0.33"
                    
#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.33
                    
#: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.33
                    
Install as a Cake Addin
#tool nuget:?package=aemarcoToolboxAppOptions&version=9.0.33
                    
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 195 9/14/2025
9.0.33 112 9/13/2025
9.0.31 120 9/13/2025
9.0.30 104 9/13/2025
9.0.6 120 9/13/2025
9.0.5 114 9/13/2025
9.0.4 112 9/13/2025
9.0.3 120 9/13/2025
8.4.13 133 9/11/2025
8.4.12 167 8/30/2025
8.4.11 220 8/6/2025
8.4.10 54 8/2/2025
8.4.9 50 8/1/2025
8.4.6 108 7/27/2025
8.4.5 143 6/20/2025
8.4.4 122 5/3/2025
8.4.3 106 4/26/2025
8.4.2 121 4/25/2025
8.4.1 191 4/20/2025
8.3.2 197 4/20/2025
8.2.11 203 4/20/2025
8.2.10 228 4/13/2025
8.2.9 198 4/6/2025
8.2.8 193 3/30/2025
8.2.7 298 3/23/2025
8.2.6 164 3/16/2025
8.2.5 154 3/2/2025
8.2.4 159 1/26/2025
8.2.3 131 1/9/2025
8.2.2 229 1/9/2025
8.1.4 156 1/1/2025
8.1.3 154 12/31/2024
8.1.2 145 12/26/2024
8.0.8 139 12/23/2024
8.0.7 144 12/23/2024
8.0.6 139 12/22/2024
8.0.5 127 12/21/2024
8.0.4 138 11/17/2024
8.0.3 168 11/17/2024
5.0.21 149 11/16/2024
5.0.20 159 10/20/2024
5.0.19 155 10/19/2024
5.0.18 174 10/19/2024
5.0.17 166 10/13/2024
5.0.16 141 10/12/2024
5.0.6 138 10/6/2024
5.0.5 154 10/2/2024
5.0.4 142 10/1/2024
5.0.3 149 9/22/2024
5.0.2 246 9/16/2024
4.0.9 163 9/15/2024
4.0.8 152 9/8/2024
4.0.7 138 9/8/2024
4.0.6 138 9/8/2024
4.0.5 130 9/8/2024
4.0.2 164 9/8/2024
3.1.27 155 9/8/2024
3.1.26 160 9/7/2024
3.1.25 175 9/7/2024
3.1.24 158 9/7/2024
3.1.23 157 9/1/2024
3.1.22 154 9/1/2024
3.1.21 174 6/16/2024
3.1.20 146 5/31/2024
3.1.19 128 5/20/2024
3.1.18 151 5/10/2024
3.1.17 176 4/12/2024
3.1.16 176 4/4/2024
3.1.15 185 3/22/2024
3.1.11 176 3/19/2024
3.1.10 186 2/16/2024
3.1.7 200 2/11/2024
3.1.6 187 2/11/2024
3.1.5 178 2/11/2024
3.1.4 168 2/11/2024
3.0.18 233 1/29/2024
3.0.17 159 1/29/2024
3.0.16 160 1/27/2024
3.0.15 157 1/27/2024
3.0.8 171 1/27/2024
3.0.7 220 1/13/2024
2.0.18 239 1/4/2024
2.0.17 252 1/1/2024
2.0.16 241 12/27/2023
2.0.15 232 12/26/2023
2.0.14 233 12/26/2023
2.0.13 206 12/25/2023
2.0.11 196 12/23/2023
2.0.10 249 12/16/2023
2.0.9 227 12/15/2023
2.0.8 238 12/14/2023
2.0.7 257 12/13/2023
2.0.5 240 12/11/2023
2.0.4 236 12/11/2023
2.0.2 263 12/10/2023
1.9.2 238 12/10/2023
1.8.4 259 12/10/2023
1.8.3 267 12/9/2023
1.8.2 257 12/9/2023
1.1.28 274 11/27/2023
1.1.27 234 11/26/2023
1.1.26 260 11/18/2023
1.1.25 247 11/17/2023
1.1.24 301 10/30/2023
1.1.23 260 10/29/2023
1.1.22 266 10/22/2023
1.1.21 280 10/17/2023
1.1.20 302 9/16/2023
1.1.19 388 8/27/2023
1.1.18 314 7/31/2023
1.1.17 360 7/16/2023
1.1.16 336 7/9/2023
1.1.15 353 7/8/2023
1.1.14 366 7/5/2023
1.1.13 318 6/29/2023
1.1.12 355 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 521 2/26/2023
1.1.6 491 2/26/2023
1.1.5 355 2/26/2023
1.1.3 345 2/25/2023