Open Regestea opened 4 months ago
Have you added builder.AddServiceDefaults()
and app.MapDefaultEndpoints()
to ensure the service discovery is included in your web application?
Service discovery doesn't work on the Wasm side, you need to look into Yarp
on the web-server side of the Blazor solution and redirect to the API.
@yarseyah I tried to add builder.AddServiceDefaults()
in Wasm project program.cs
file but it gave me a lot of error, and also we don't have app
in Blazor Web assembly standalone so I can't use app.MapDefaultEndpoints()
and also I take looked at builder.Configuration of my blazor project and it's almost empty
I'm not sure there are any Aspire components that make sense for the Blazor Wasm. You can add service discovery, etc., to the Blazor Server, but your client is entirely standalone—you want to send your API calls to the server and have the server, via Yarp, redirect your requests to the API.
Describe the bug
i referenced the blazor project to Aspire app host so this is my aspire app host code
and this is my blazor code to add HTTP client
so as you can see in the result it doesn't replace the
http://identityserverapi
with the actual addressand also i found the
builder.Configuration.GetConnectionString("identityserverapi");
doesn't work because we don't haveappsettings.json
in blazor wasm so i think Aspire doesn't work fo the blazor wasm