Remove dependency on System.Console in default Blazor WASM app #31148
Labels
area-blazor
Includes: Blazor, Razor Components
Done
This issue has been fixed
feature-blazor-wasm
This issue is related to and / or impacts Blazor WebAssembly
task
Milestone
There is a single place in a Blazor WASM app that references
System.Console
:aspnetcore/src/Components/WebAssembly/WebAssembly/src/Hosting/EntrypointInvoker.cs
Lines 84 to 88 in 26a88e0
This place is the main entry point for the application, and it catches all exceptions and writes them to the console. Since it is the only place that references
System.Console
in the application, if we can change this code to not referenceSystem.Console
, the wholeSystem.Console.dll
assembly can be removed, which is currently at 6KB .br compressed.One idea on how to remove this is to use Mono's built-in functionality for invoking the Main entrypoint instead of having that functionality in ASP.NET.
cc @lewing @pranavkm @captainsafia @marek-safar
The text was updated successfully, but these errors were encountered: