I am developing an mvc application, I need to save some preconfiguration settings into DB. so where i can put my custom code to do that. When ever the IIS is resetted my code should need to work.
1 Answer
If you want to execute some code every time the application pool starts (or is recycled), like when an IIS reset is done, then you can execute it on the ApplicationStart event.
Add your code to the Application_Start event handler in Global.asax.cs
1 Comment
Katie Kilian
Note that the code won't run right after IIS is reset; it run when the application is started again. Those two things are subtly different.