-
Notifications
You must be signed in to change notification settings - Fork 568
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
These changes allow Aspire service discovery to work in a hosted Blaz… #7162
Conversation
A change this big should be an issue with an API proposal and a design. That will dramatically increase the changes of it getting reviewed and aligned with a release. |
Hi @davidfowl ! Thanks for your interest. I'm happy for you to guide me through that if that's what I need to do. It's my first time contributing to Aspire. I saw a lot of issues already about getting Aspire to play nicely with Blazor (server, webassembly, hosted and standalone), or tangentially related to using Aspire with front end GUIs. People seem to agree that it has loads of potential! I wasn't sure another issue would be appreciated. Should we use an existing one? I thought maybe, out of these open issues, the fourth one is pretty much exactly what my PR is about:
Shall we use that rather than open a fresh one? Do you have a template for an API proposal and design I can follow please? |
The a code example for setting the opening browser to a fixed port. A TargetPort cannot be set from the launchSettings. |
…or WebAssembly app. It basically integrates my Nuget package Aspire4Wasm into Aspire (with the addition of a few classes and changing none of the existing ones). The changes allow an Aspire AppHost to define the web API (or APIs) that a Blazor app should access, and to pass that service discovery information to the app by writing to its appsettings.json files. It does not make the developer experience with Blazor in Aspire totally seamless. For example, I'm still having difficulty with stand-alone Blazor WebAssembly apps, and I haven't figured out how to stop the app launching on a random port as well as the one specified in launchsettings.json. However, it is a big step in the right direction. If you want to see what it does before accepting the changes, please try the nuget package Aspire4Wasm (version 3.0.0 at the time of writing).
@BenjaminCharlton sorry for delay. there is an issue template for it, direct link https://github.com/dotnet/aspire/issues/new?template=30_api-proposal.md I'll close this meantime - you can reopen if/when. Thanks for the proposal/work. |
Thanks for the template, @danmoseley. |
looks great, we'll triage it. |
Thank you sir! |
These changes allow Aspire service discovery to work with a hosted Blazor WebAssembly app.
It basically integrates my Nuget package Aspire4Wasm (source code here) into Aspire (with the addition of only 5 new classes and 2 interfaces, and changing none of the existing ones).
The changes allow an Aspire
AppHost
to define web APIs that a Blazor app can access, and pass that service discovery information to the app by writing to itsappsettings.{environment}.json
files.These changes will not make the Aspire developer experience with Blazor totally seamless. For example, I'm still having difficulty with stand-alone Blazor WebAssembly apps, and I haven't figured out how to stop the app launching on a random port as well as the one specified in
launchsettings.json
. However, this is a step in the right direction and will help make Aspire a bit more Blazor-friendly. If you want to see what it does before accepting the changes, try the Nuget package Aspire4Wasm (version 3.0.0 at the time of writing).Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):