The AppHost's clientwebwasm resource can't start because Aspire's proxy holds its port

Open Beginner friendly
#15,108 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, wasm
Domain
devops

Research direction

Start in Boilerplate.Server.AppHost/Program.cs, where the clientwebwasm resource and its endpoint are declared, and in the Boilerplate.Web launch profile of Boilerplate.Client.Web's launchSettings, which sets the port 4225 the dev server binds. Confirm the bind conflict by starting the explicit-start resource from the AppHost. Done when the resource starts without the 'address already in use' error and the standalone app loads, and the proposed endpoint change is checked against the issue's suggested fix.

Written by the indexing model from the issue text.

Description

area / templates

In a project created with bit new 11.0.0-pre-20 (Aspire 13.6.5), starting the explicit-start clientwebwasm resource fails at once:

Failed to bind to address http://127.0.0.1:4225: address already in use.

Aspire takes the resource's endpoint from the Boilerplate.Web(BlazorWebAssemblyStandalone) launch profile of Boilerplate.Client.Web (http://localhost:4225), and its proxy listens on that port. The WebAssembly dev server then binds the launch profile's address itself, not the port Aspire gives it, so the standalone app can't run from the app host. Running it outside, with dotnet run --no-launch-profile --urls http://localhost:<another port> in Boilerplate.Client.Web, works.

A possible fix in Boilerplate.Server.AppHost/Program.cs: leave that endpoint unproxied (.WithEndpoint("http", e => e.IsProxied = false)), so only the dev server listens on 4225.

Dominant language
C#
Stars
1.4k
Forks
264
Avg merge
8h 58m
Merged PRs (30d)
579

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bitfoundation/bitplatform

All issues in bitfoundation/bitplatform

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.