Aspnetcore: Config

Created on 4 Jun 2018  路  6Comments  路  Source: dotnet/aspnetcore

Provide a model for app configuration, like specifying the URL for an API endpoint.

Would we use Microsoft.Extensions.Configuration for this?
Where config source would we use? Local storage? Embedded resources?
How would change notification work?

area-blazor enhancement

Most helpful comment

I am in a similar situation to @sanzor I have my API split from the client-side blazor app. I am having trouble passing in the URL for production/local without hardcoding it

All 6 comments

Pehaps using a json/xml/ini file that is served from the server?
This way it could be possible to get user specific configuration from another source like a database.
The only way to make change notification work is with websockets (or better, signalr).

I would also prefer using Microsoft.Extensions.Configuration, why create yet another configuration framework?

Hi,

I found a way to configure my app using the URI and Microsoft.Extensions.Configuration. https://remibou.github.io/Configuring-a-Blazor-app/, please tell me what you think about it.

I am facing a similar issue when i need to find out the hostname of the server project in the Startup of my client one. Is there any way to pass data from blazor server to blazor client at startup ? Can i set a configuration in my server project and then somehow pass it so that it gets available for the client at Startup ?
P.S I am using client-side blazor.

I am in a similar situation to @sanzor I have my API split from the client-side blazor app. I am having trouble passing in the URL for production/local without hardcoding it

I'm having this issue as well, settings such as the API URL to use need a way to be changed based on the environment.

We've added Microsoft.Extensions.Configuration to the Blazor WebAssembly host. Let's use https://github.com/dotnet/aspnetcore/issues/18675 to track what config source(s) we want to provide out of the box.

Was this page helpful?
0 / 5 - 0 ratings