AspNetCore.Docs
AspNetCore.Docs copied to clipboard
Blazor WASM options configuration coverage
Based on the documentation, I can bind an options object using code like this:
builder.Services.Configure<PositionOptions>( builder.Configuration.GetSection(PositionOptions.Position));
Unfortunately, this doesn't work unless we include the Microsoft.Extensions.Options.ConfigurationExtensions package. It would be great if the documentation mentioned this.
Thanks!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 7367a651-2b27-0a57-e7d0-95686cc97f1c
- Version Independent ID: 8c769648-728d-72ce-ebf6-2a06e5076aa2
- Content: ASP.NET Core Blazor configuration
- Content Source: aspnetcore/blazor/fundamentals/configuration.md
- Product: aspnet-core
- Technology: aspnetcore-fundamentals
- GitHub Login: @guardrex
- Microsoft Alias: riande
I just tested and it works fine without it.
Hi Rick - could you please test it while creating a Blazor Wasm application? That's where I ran into the problem.
@dougclutter ... ~Look at the Blazor version of the doc. I placed examples for everything that WASM can do with ASP.NET Core config, including mini-examples. I also think that all of the required package mentions are there. If you find a scenario that's missing a package mention, please open a new issue from the bottom of that topic (This page feedback button+form).~
https://docs.microsoft.com/aspnet/core/blazor/fundamentals/configuration
No, let's go ahead and repurpose this issue. I'll change the metadata and update the title. I should make a pass on Options config and expand the doc at least a little to call out either that everything works as expected from the main doc or scope the scenarios that do work. I'll add the namespace either way.
Note that we're crazy busy 🏃😅 for the upcoming .NET 7 release, so I expect that it will take quite a while to reach this. I'll probably get back to it very late this year or 23Q1.
@guardrex - I understand crazy busy Luke; thanks for looking into it.