0

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 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.