ASP.NET Core appsettings.json update in code

后端 未结 9 2024
小鲜肉
小鲜肉 2020-12-13 01:54

I am currently working on project using asp.net core v1.1, and in my appsettings.json I have:

\"AppSettings\": {
   \"AzureConnectionKey\": \"***\",
   \"Azu         


        
9条回答
  •  猫巷女王i
    2020-12-13 02:34

    I'm using my own configuration section and my own strongly typed object. I'm always injecting IOptions with this strongly typed object. And I'm able to change configuration in runtime. Be very careful with scopes of objects. New configuration values are picked up by request scoped object. I'm using constructor injection.

    Documentation on this is very unclear though .. I'm no sure if this is meant to be. Read this in-depth discussion

提交回复
热议问题