Aspnetcore: Consider exposing IWebAssemblyHostEnvironment from WebAssemblyHostBuilder

Created on 16 Mar 2020  路  3Comments  路  Source: dotnet/aspnetcore

As part of the config change, we added a IWebAsemblyHostEnvironment to Blazor that exposes the host's environment: https://github.com/dotnet/aspnetcore/blob/blazor-wasm/src/Components/WebAssembly/WebAssembly/src/Hosting/IWebAssemblyHostEnvironment.cs. The type is added to DI which makes it difficult to use as part of startup code. We should consider additionally exposing it as part of WebAssemblyHostBuilder as a property.

In addition, the host environment is also missing convenience extension methods such as IsDevelopment, IsProduction etc. We should consider porting those over.

Done area-blazor blazor-wasm enhancement

Most helpful comment

Yes plz

All 3 comments

/cc @rynowak

Yes plz

Done in https://github.com/dotnet/aspnetcore/pull/20008
(@captainsafia or if there was anything remaining, please let us know)

Was this page helpful?
0 / 5 - 0 ratings