Flash.Configuration
8.0.0
dotnet add package Flash.Configuration --version 8.0.0
NuGet\Install-Package Flash.Configuration -Version 8.0.0
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="Flash.Configuration" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Flash.Configuration" Version="8.0.0" />
<PackageReference Include="Flash.Configuration" />
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 Flash.Configuration --version 8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Flash.Configuration, 8.0.0"
#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.
#addin nuget:?package=Flash.Configuration&version=8.0.0
#tool nuget:?package=Flash.Configuration&version=8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Flash.Configuration
Flash.Configuration is a configuration management tool that enables dynamic parsing and updating of configuration settings, including updating configuration files after build.
Features
- Dynamic configuration parsing: Supports parsing configuration files in JSON format. Extracts and structures configuration data for easy access.
- Automatic configuration updates: Updates configuration files dynamically based on specified rules. Ensures configurations remain up to date without manual intervention.
- Post-Build configuration handling: Automatically modifies configuration files after the application build process. Useful for adapting settings to different environments (e.g., development, staging, production).
- Environment-specific configurations: Manages different configuration files based on the target deployment environment. Allows seamless switching between settings for different use cases.
- Validation and Error Handling: Includes built-in validation mechanisms to detect and report misconfigurations. Logs errors and warnings for troubleshooting issues.
- Extensibility and Customization: Allows developers to define custom processing rules for configurations. Supports plug-in extensions to enhance functionality.
Getting Started
Installation
To add the latest NuGet package:
Install-Package Flash.Configuration --version 8.0.0
or
dotnet add package Flash.Configuration --version 8.0.0
The package can work with the following project types:
- Console Application
- Web API
- Class Library
- Web API (native AOT)
- Worker service
Prerequisites
- .NET 8 or higher.
Usage
Create a class for configuration
Sample
[FlashOrder(4)]
[FlashConfig("ConnectionStrings", environment: "Development")]
[FlashConfig("ConnectionStrings", environment: "Staging")]
public class ConnectionStrings
{
[FlashProperty("DefaultConnection")]
[FlashValue("Server=dev.localhost;Database=dev_db;User Id=dev_user;Password=******;", environment: "Development")]
[FlashValue("Server=staging.localhost;Database=staging_db;User Id=staging_user;Password=******;",
environment: "Staging")]
public string DefaultConnection { get; } = string.Empty;
[FlashIgnore]
[FlashProperty("Enabled")]
[FlashValue(false, environment: "Development")]
[FlashValue(true, environment: "Staging")]
public bool Enabled { get; }
}
- Add the following configuration files to the project:
appsettings.Development.json
appsettings.Staging.json
- Build the project;
- The configuration files should be updated:
appsettings.Development.json
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "ConnectionStrings": { "DefaultConnection": "Server=dev.localhost;Database=dev_db;User Id=dev_user;Password=******;" } }
appsettings.Staging.json
{ "Logging": { "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" } }, "ConnectionStrings": { "DefaultConnection": "Server=staging.localhost;Database=staging_db;User Id=staging_user;Password=******;" } }
- The configuration files should be updated:
Advanced usage
⚠️ Warning The advanced complex sample is available with the link with all classes and configuration files.
Product | Versions 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.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 |
---|---|---|
8.0.0 | 109 | 2/23/2025 |
- Added support for .NET 8.0;