Consider exposing the application url using IWebAssemblyHostEnvironment #19910
Labels
area-blazor
Includes: Blazor, Razor Components
Done
This issue has been fixed
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-blazor-wasm
This issue is related to and / or impacts Blazor WebAssembly
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Application developers that need to resolve a resource from their app in
Program.MainAsync
have to build theIServiceCollection
and resolve theNavigationManager
from DI. We usually tell users not to build the service container. It would be much more convenient if the interface exposed the URI. In tandem with #19900, this would make doing things at startup much more reasonable. We could even consider removing theAddBaseAddressHttpClient
extension method if this were available:The last bit might also play better with users having to configure a custom
HttpMessageHandler
on theHttpClient
instance.The text was updated successfully, but these errors were encountered: