Uh oh!
There was an error while loading. Please reload this page.
[release/7.0] WasmAppHost: Fix crash when starting wasmbrowser project - #76236
Conversation
This could fail like: ``` WasmAppHost --runtime-config /tmp/cc/bin/Debug/net7.0/browser-wasm/AppBundle/cc.runtimeconfig.json --forward-console Unhandled exception. System.InvalidOperationException: Failed to determine web server's IP address or port at Microsoft.WebAssembly.AppHost.WebServer.StartAsync(WebServerOptions options, ILogger logger, CancellationToken token) at Microsoft.WebAssembly.AppHost.BrowserHost.StartWebServerAsync(String appPath, Boolean forwardConsole, String[] urls, CancellationToken token) at Microsoft.WebAssembly.AppHost.BrowserHost.RunAsync(ILoggerFactory loggerFactory, CancellationToken token) at Microsoft.WebAssembly.AppHost.BrowserHost.InvokeAsync(CommonConfiguration commonArgs, ILoggerFactory loggerFactory, ILogger logger, CancellationToken token) at Microsoft.WebAssembly.AppHost.WasmAppHost.Main(String[] args) at Microsoft.WebAssembly.AppHost.WasmAppHost.<Main>(String[] args) ``` Instead read the addresses on application lifetime's ApplicationStarted event.
ghost
commented
Sep 27, 2022
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsThis could fail like: Instead read the addresses on application lifetime's ApplicationStarted event.
|
Uh oh!
There was an error while loading. Please reload this page.
pavelsavara
commented
Sep 27, 2022
Also could we remove |
Also we had the issue with "unsafe ports" (as considered by browsers) on helix . Should we try to avoid those port numbers here too ? |
carlossanlop
commented
Sep 27, 2022
@radical is this a product code change? If yes, can you please fill out the template in the description, add the servicing-consider label and then send an email to Tactics to request approval? |
radical
commented
Sep 28, 2022
@carlossanlop approved over email |
radical
commented
Sep 28, 2022
The wasm/aot failure is #76110 . |
carlossanlop
commented
Sep 28, 2022
@radical some pending things:
|
radical
commented
Sep 29, 2022
Not in this PR.
Done
|
radical
commented
Sep 29, 2022
@pavelsavara about the unsafe ports, is there a list of the ports that chrome would reject? And I guess, other browsers. |
pavelsavara
commented
Sep 29, 2022
Chrome FF |
radical
commented
Sep 29, 2022
@carlossanlop this is ready to go! |
carlossanlop
commented
Sep 29, 2022
Let's do this! 💪🏼 |
extracted from three browsers' sources: dotnet/runtime#76236 (comment).
* block all unsafe ports extracted from three browsers' sources: dotnet/runtime#76236 (comment). * fb * sort
extracted from three browsers' sources: dotnet/runtime#76236 (comment).
extracted from three browsers' sources: dotnet/runtime#76236 (comment).
/cc @lewing@thaystg@pavelsavara
Customer impact
On 7.0, we created a new template to create a wasm browser app without using blazor, but running it would crash because we try to read the web server addresses right after
await host.StartAsync, but they might not be available at that time. Instead, we now read the addresses in response to theApplicationStartedevent.This could fail like:
Testing
Unit tests with workloads, and manual testing.
Risk
Low risk, prevents a crash.