.net dynamically refresh app.config

前端 未结 10 782
闹比i
闹比i 2020-12-02 23:28

How do I dynamically reload the app.config in a .net Windows application? I need to turn logging on and off dynamically and not just based upon the value at application sta

10条回答
  •  时光取名叫无心
    2020-12-02 23:58

    I think I read in the log4net documentation that this is not possible.

    Try having the logging in an external logfile that can be watched with a filesystemwatcher

    Update: Found it again.. http://logging.apache.org/log4net/release/manual/configuration.html#.config%20Files

    There is no way to reload the app.config during runtime.

提交回复
热议问题