Wolf Donner
Wolf Donner

Reputation: 195

Blazor - Merge .json file to IConfiguration

So in Blazor you get an instance implementing IConfiguration as default service. No need to register it yourself. My Question is: Can I load additional .json files into the default IConfiguration instance? And if not, is it possible to register my own IConfiguration and load different .json files into it? And if so, how?

Upvotes: 0

Views: 375

Answers (1)

benjamin
benjamin

Reputation: 1654

There's some useful documentation here:

Yes, you can load additional files like this:

(assuming that var stream is a stream from a Json configuration file).

builder.Configuration.AddJsonStream(stream);

Upvotes: 1

Related Questions