aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Config

Open danroth27 opened this issue 8 years ago • 6 comments

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?

danroth27 avatar Jun 04 '18 20:06 danroth27

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?

zefubachs avatar Jun 04 '18 21:06 zefubachs

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.

RemiBou avatar Feb 21 '19 23:02 RemiBou

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.

sanzor avatar Aug 02 '19 05:08 sanzor

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

razfriman avatar Aug 12 '19 21:08 razfriman

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.

MarkFl12 avatar Oct 27 '19 11:10 MarkFl12

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.

danroth27 avatar Jan 30 '20 00:01 danroth27