I have a .NET 8 solution consisting of:
- An ASP.NET Core 8 Web API with controllers
- A Blazor application (.NET 8 with interactive rendering in auto mode, so there's a Blazor Server assembly and a Blazor WASM assembly)
- .NET Aspire AppHost
In the AppHost, I am passing environment variables to the API and Blazor projects in local development using .WithEnvironment().
One of the environment variables I pass to the Blazor app is the API's "Base URL". This is needed to configure the HttpClient in the WASM assembly.
The issue I have is that the WASM assembly doesn't seem to be able to see the environment variables being passed to the Blazor project by Aspire.
How can I pass the environment variables from my Blazor server app to the Blazor WASM client app that is created along side it and that the Blazor server app references?