Impact of changes to web.config and app.config

I have windows services written in C # .net. If I need to modify the app.config file, do I need to restart the Windows Service application so that it picks up new changes?

Also, if I change the connection string of web.config, does the application pool start automatically?

Thanks.

+6
source share
3 answers

The answer to the first question is yes. If you do not implement any automatic file browsing and domain restart schemes, yes, the app.config files for services or other types of applications must be re-read so that the changes are applied.

As for the second one, yes, ASP.NET will detect changes to the web.config files and automatically reboot the application domain.

+9
source

Yes, you need to restart the service for it to make changes. As for the application pool, it also needs to be restarted if you change anything in the web.config file so that it can make changes.

+3
source

Changes to web.config always restart your web application. This is not the same as the pool application being processed, but the specific application domain is downloaded and loaded again.

Regards to app.config, you can make all the necessary changes, just a file. If you need to restart the application depends on your logic, if you only read app-config during startup or during normal program execution.

+2
source

Source: https://habr.com/ru/post/906232/


All Articles