CasCap.Common.Configuration.Blazor 5.2.1

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

CasCap.Common.Configuration.Blazor

Optional .NET 10/11 Razor class library for embedding typed runtime-control editing in an existing Blazor frontend. It calls the authorized management API; it references only browser-neutral Contracts and Blazor packages, never Runtime, EF Core, SQL/Redis clients or server configuration.

Installation

dotnet add package CasCap.Common.Configuration.Blazor

Usage

Register RuntimeConfigurationClient<T> in the existing browser DI container. Reuse its same-origin authenticated HttpClient:

builder.Services.AddScoped<RuntimeConfigurationClient<BrowserControls>>();

The host provides its browser-safe DTO from a shared contracts assembly and its existing authentication, navigation and render mode. Interactive WebAssembly is the simplest cookie-based integration: the browser retains the HttpOnly cookies and sends same-origin requests. The RCL imposes no render mode. An Interactive Server host must explicitly provide a per-user authenticated HTTP client and paired-cookie handling; server-side HttpClient does not automatically inherit browser authentication. Never use an application-wide privileged client for every browser user.

Mount RuntimeConfigurationEditor<T> inside an existing interactive page, with typed fields rather than a key/string-value catalogue:

@using CasCap.Common.Configuration.Blazor.Components
@using CasCap.Common.Configuration.Management.Contracts.Models

<RuntimeConfigurationEditor T="BrowserControls" Destination="_destination">
    <Fields Context="value">
        <label for="diagnostic-verbosity">Verbosity</label>
        <InputNumber id="diagnostic-verbosity" @bind-Value="value.Verbosity" min="0" max="5" />
        <label for="diagnostic-feature">Feature enabled</label>
        <InputCheckbox id="diagnostic-feature" @bind-Value="value.FeatureEnabled" />
        <label for="diagnostic-window">Diagnostic window</label>
        <InputDuration id="diagnostic-window" @bind-Value="value.Window" />
    </Fields>
</RuntimeConfigurationEditor>

@code {
    private readonly RuntimeConfigurationDestination _destination =
        new("sample-app", "staging", "controls");
}

The page imports the host's DTO and Microsoft.AspNetCore.Components.Forms. Use an ordinary forms-compatible mutable DTO or record for the independent editing copy, with DataAnnotations; no accepted monitor object is mutated. Enum fields use typed InputSelect<TEnum>, numbers use InputNumber<TNumber>, and InputDuration preserves TimeSpan with invariant hours:minutes:seconds input. The host chooses bounds and DTO enum converters shared with the server. Supply unique visible labels/IDs in every field fragment. The page owns its h1, routing, sign-in and navigation chrome.

Include the host's normal generated .styles.css bundle so the RCL's isolated styles load. The editor supplies bordered native controls, responsive card spacing and visible focus/disabled states even when the host resets browser defaults. It inherits the host font and uses MudBlazor palette CSS variables when available, with standalone fallbacks; no MudBlazor dependency is added. Scoped descendant styles also cover forms-compatible inputs supplied by the host field fragment. No JavaScript plugin, assembly scanner, external font or extra component framework is needed.

Configuration Examples

The destination is immutable host bootstrap, not a user-selected arbitrary database/environment. It must exactly match the server's registered scope. Server policies remain authoritative, even when the UI hides a field or operation.

<RuntimeConfigurationEditor T="BrowserControls"
                            Destination="_destination"
                            Title="Operational controls"
                            OnCommitted="DocumentCommittedAsync">
    <Fields Context="value">
        <label for="operational-verbosity">Verbosity</label>
        <InputNumber id="operational-verbosity" @bind-Value="value.Verbosity" />
    </Fields>
</RuntimeConfigurationEditor>

DocumentCommittedAsync receives a RuntimeConfigurationDocument<BrowserControls> only after durable commit; it is not an applied/replica acknowledgement. If the host customizes MVC JSON naming/converters, construct the client with matching JsonSerializerOptions explicitly. Do not globally register browser serializer settings that break other typed clients.

Editing and Failure Behavior

  • Read the authoritative durable document, including its revision and any expiry. It is not the runtime reader's effective state; an expired durable head can differ from the startup baseline.
  • Preview validates the typed candidate without publishing. Editing a previewed control invalidates that preview. Publication requires a reason and explicit destination confirmation.
  • Optional temporary lifetime is 1-1440 minutes; absence publishes without expiry.
  • Every POST obtains a new principal-bound antiforgery token using the host's issued header name. Tokens remain local to the request, never browser storage or logs.
  • Publication uses exact .NET long revision serialization, not a JavaScript number conversion. Committed replies explicitly leave activation pending.
  • Validation, sign-in, permission, missing-document, conflict, unavailable and malformed-response states are distinct. Failed publication preserves entered values and never retries automatically. After an unavailable/uncertain result, investigate or reload before another explicit decision.
  • Reloading dirty values and leaving a dirty page require explicit discard confirmation. Requests cancel on destination changes/disposal; the editor does not reuse an old scope's form.
  • Native labeled inputs, form submission and buttons support keyboard operation; isolated styles allow controls/actions to wrap. The host still needs its own browser/accessibility verification.

See the server setup, wire contract, consumer guide and component tests. History browsing, restore, promotion, arbitrary scope discovery and live activation dashboards are deliberately not part of this editor.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.  net11.0 is compatible. 
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
5.2.1 93 11/21/2026
5.2.0 134 11/14/2026
5.1.0 171 11/5/2026
5.0.0 111 11/1/2026