Hi @Mayur Phase,
When I restart the application site from IIS server , I want to call WarmUpCache method but it is not working
Based on your description, I think your main requirement is this, right? If this is the case, just try something like this:
public static class SomeStartupClass
{
public static void Init()
{
// whatever code you need
}
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
//something else what you need.
SomeStartupClass.Init();
}
And the Application_start method is executed when the web.config file changes or when the web server is restarted (or when the IIS application pool is manually recycled). In short, it is the entry point of the application and the user cannot call it manually.
If I misunderstand anything, please let me know.
Best regards,
Xudong Peng
If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.