static void

Blazor Configuration

In WASM, it's wwwroot\appsettings.json - note it's client side, and there's no support.

@inject IConfiguration Configuration

<p>@(Configuration.GetValue<string>("AppName"))</p>

For IOptions, add nuget Microsoft.Extensions.Options.ConfigurationExtensions

//needs Microsoft.Extensions.Options.ConfigurationExtensions
builder.Services.Configure<AppSettings>(builder.Configuration.GetSection("settings"));

And in components

@inject IOptions<AppSettingsAppSettings

<p>@AppSettings.Value.AppName</p>