Sorry about the trouble guys, I have rephrased it as a new question here: MVC: Run a method on Application startup without calling it from Application_Start
This may be a very simple question but what's the best way to have an interface with a method OnStartup
. When this interface is implemented, the OnStartup()
code should run on application_start.
EDIT: I am actuall trying to create a HttpModule or something so that When I implement a particular class of this module, this class would have a method and by overriding this method, I will be able to run its code on application startup.
My only problem is that I don't want to call any code directly from application_start method.
P.S. If there is a nuget package available for this, please tell me the name.