You must Sign In to post a response.
  • Category: ASP.NET

    Application is automatically restart

    I have created an application and, I am facing one problem and came to know that My application is automatically restart while create new folder automatically in a system at run time.

    I have researched so many links and i found alternate solution, and using this solution i have put one key inside the web config - maxWaitChangeNotification="360000" waitChangeNotification="360000" and problem is solved

    But the main thing is that whenever i upload the new changes, i have removed that key because of no new changes were reflected on site(due to above key)

    I have used framework "2.0"

    Now i want to remove this key and get the permanent solution.

    So kindly suggest is there any way to "My web Application is not restart" while create new folder automatically in a system at run time

    Bhavik Shah
  • #768380

    First check whether you are having following tag in your .aspx page:

    <meta http-equiv="refresh" content="30">

    This tag will continuously refresh you page (automatically) after given interval.
    If its present, then please remove it.

  • #768392
    It is a default a behavior that when you create a new folder in application context the IIS gets restart so the application too, Whenever there is any change in the web.config or in virutal directory, application will be restarted and hence created sessions also expired.
    The workaround is, Adding "fcnMode="Disabled" to the <httpRuntime> settings in the web.config disables AppDomain recycling when the contents of the web root folder are altered OR storing and handling your temp files in a different folder outside the wwwroot of your application also solves the problem.
    Another solution Is, add following code appears to resolve the issue, when added to Application_Start() in Global.asax

    PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
    object o = p.GetValue(null, null);
    FieldInfo f = o.GetType().GetField("_dirMonSubdirs", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase);
    object monitor = f.GetValue(o);
    MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", BindingFlags.Instance | BindingFlags.NonPublic);
    m.Invoke(monitor, new object[] { });

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • Sign In to post your comments