0

I have a static class, containing vaious settings fon .NET web api 2 (mostly parameters, links, flags etc.). Those parameters are filled from XML - file on startup. The task is to make them changeable through website. As I understand it, when the app is running on the IIS App pool, it creates several independent threads (as in several running apps), so even if I change the setting in the file, no other thread will pick this change up.

The question: Is there a way to somehow notifty the entire app pool to re-read the settings from file, but do it once? Maybe with using a "last update date"?

Alex
  • 83
  • 7
  • Please confirm you're referring to the `System.Web`-based "Web API 2" platform and not ASP.NET Core 2.x. – Dai Mar 17 '22 at 00:58
  • "As I understand it, when the app is running on the IIS App pool, it creates several independent threads (as in several running apps), so even if I change the setting in the file, no other thread will pick this change up." - no, this is incorrect. IIS Application Pools are concerned with worker processes, not threads. – Dai Mar 17 '22 at 00:59
  • @Dai, yes, it is Web API 2. Also, I've read this [link](https://stackoverflow.com/questions/200469/what-is-the-difference-between-a-process-and-a-thread). Does that mean that inter-thread communication is not the solution and instead I should look into something more System. - based? Do I need something like in-memory variable that can be accessed by any process that runs my app? – Alex Mar 17 '22 at 05:25

0 Answers0