-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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.
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsThis could fail like:
Instead read the addresses on application lifetime's ApplicationStarted event.
|
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 ? |
@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? |
@carlossanlop approved over email |
The wasm/aot failure is #76110 . |
@radical some pending things:
|
Not in this PR.
Done
|
@pavelsavara about the unsafe ports, is there a list of the ports that chrome would reject? And I guess, other browsers. |
Chrome FF |
@carlossanlop this is ready to go! |
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 theApplicationStarted
event.This could fail like:
Testing
Unit tests with workloads, and manual testing.
Risk
Low risk, prevents a crash.