![]() |
VOOZH | about |
dotnet add package Aguacongas.DynamicConfiguration.WebApi --version 3.1.0
NuGet\Install-Package Aguacongas.DynamicConfiguration.WebApi -Version 3.1.0
<PackageReference Include="Aguacongas.DynamicConfiguration.WebApi" Version="3.1.0" />
<PackageVersion Include="Aguacongas.DynamicConfiguration.WebApi" Version="3.1.0" />Directory.Packages.props
<PackageReference Include="Aguacongas.DynamicConfiguration.WebApi" />Project file
paket add Aguacongas.DynamicConfiguration.WebApi --version 3.1.0
#r "nuget: Aguacongas.DynamicConfiguration.WebApi, 3.1.0"
#:package Aguacongas.DynamicConfiguration.WebApi@3.1.0
#addin nuget:?package=Aguacongas.DynamicConfiguration.WebApi&version=3.1.0Install as a Cake Addin
#tool nuget:?package=Aguacongas.DynamicConfiguration.WebApi&version=3.1.0Install as a Cake Tool
Library to add configuration Web API to an ASP.NET 6 web site.
Program.cs
using Aguacongas.DynamicConfiguration.Redis;
using Yarp.Configuration.Model;
using Swashbuckle.AspNetCore.SwaggerUI;
using Aguacongas.DynamicConfiguration.WebApi.Controllers;
var builder = WebApplication.CreateBuilder(args);
var configuration = builder.Configuration;
// Add Redis configuration provider.
configuration.AddRedis(options => configuration.GetSection(nameof(RedisConfigurationOptions)).Bind(options));
var services = builder.Services;
// Add services to the container.
services.Configure<ReverseProxyOptions>(configuration.GetSection(nameof(ReverseProxyOptions)))
.AddAuthorization(options =>
{
// The web api requires 2 policies, DYNAMIC_CONFIGURATION_READER_POLICY and DYNAMIC_CONFIGURATION_WRITTER_POLICY
// In this sample those policies requires nothing, all users have access to the api.
// You should update this code to meet your requirement.
options.AddPolicy(ConfigurationController.DYNAMIC_CONFIGURATION_READER_POLICY,
builder => builder.RequireAssertion(context => true));
options.AddPolicy(ConfigurationController.DYNAMIC_CONFIGURATION_WRITTER_POLICY,
builder => builder.RequireAssertion(context => true));
});
services.AddAuthentication(); // this sample doesn't have authentication system but shoudl add yours.
services.AddControllersWithViews()
.AddConfigurationWebAPI(builder.Configuration, options => options.Provider = ((IConfigurationRoot)configuration).Providers.First(p => p is RedisConfigurationProvider));
services.AddRazorPages();
services.AddSwaggerGenFromConfiguration(configuration);
var app = builder.Build();
// Auto reload the configuration when changes occur.
app.SubscribeToConfigurationChanges();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseWebAssemblyDebugging();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger()
.UseSwaggerUI(c =>
{
configuration.GetSection(nameof(SwaggerUIOptions)).Bind(c);
});
}
app.UseHttpsRedirection()
.UseBlazorFrameworkFiles()
.UseStaticFiles()
.UseAuthentication()
.UseAuthorization();
app.MapRazorPages();
app.MapControllers();
app.MapFallbackToFile("index.html");
app.Run();
appsetting.json
{
"AllowedHosts": "*",
"RedisConfigurationOptions": {
"ConnectionString": "localhost",
"HashKey": "Aguacongas.DynamicConfiguration.AdminApi",
"Channel": "Aguacongas.DynamicConfiguration.AdminApi.Channel"
},
"OpenApiInfo": {
"Title": "DynamicConfiguration Admin API",
"Description": "API used to manage YARP.",
"Version": "v1",
"Contact": {
"Name": "Olivier Lefebvre",
"Email": "olivier.lefebvre@live.com",
"Url": "https://github.com/aguacongas"
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Aguacongas.DynamicConfiguration.WebApi:
| Package | Downloads |
|---|---|
|
Aguacongas.TheIdServer
OpenID/Connect , OAuth and WS-Federation server base on Duende IdentityServer. |
Showing the top 1 popular GitHub repositories that depend on Aguacongas.DynamicConfiguration.WebApi:
| Repository | Stars |
|---|---|
|
Aguafrommars/TheIdServer
OpenID/Connect, OAuth2, WS-Federation and SAML 2.0 server based on Duende IdentityServer and ITFoxtec Identity SAML 2.0 with its admin UI
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.0 | 2,688 | 11/21/2025 |
| 3.0.1 | 438 | 11/21/2025 |
| 3.0.0 | 523 | 11/13/2025 |
| 2.0.0 | 8,712 | 11/24/2023 |
| 2.0.0-preview2- | 304 | 11/13/2025 |
| 2.0.0-preview1-0080 | 1,026 | 10/4/2023 |
| 1.0.1 | 5,194 | 2/2/2023 |
| 1.0.1-preview1-0044 | 355 | 2/2/2023 |
| 1.0.0 | 9,026 | 12/25/2021 |
| 1.0.0-preview1-0057 | 404 | 12/23/2021 |