Loading app.config into the AppDomain

后端 未结 2 1101
遇见更好的自我
遇见更好的自我 2021-02-13 10:23

I can\'t get the App.Config file to load into the App Domain.

I\'m using

[System.AppDomain]::CurrentDomain.SetData(\"APP_CONFIG_FILE\", $config_path)
         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-13 10:39

    Have you tried the solution presented here: Change default app.config at runtime

    It appears to describe some sort of cache, and that more work has to be done to ensure the loaded data is read.

    Th important part of the first answer is: "There exists a class ClientConfigPaths that caches the paths. So, even after changing the path with SetData, it is not re-read, because there already exist cached values. The solution is to remove these, too"

提交回复
热议问题