-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyThis issue is related to and / or impacts Blazor WebAssemblytask
Milestone
Description
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
| private static void HandleStartupException(Exception exception) | |
| { | |
| // Logs to console, and causes the error UI to appear | |
| Console.Error.WriteLine(exception); | |
| } |
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 reference System.Console, the whole System.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.
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyThis issue is related to and / or impacts Blazor WebAssemblytask