View Code
ที่มา :- http://www.narisa.com/forums/index.php?showtopic=27585
- http://stackoverflow.com/questions/3610240/how-to-disable-filemonitoring-on-iis-using-c-sharp-code
- http://www.ruxcom.com/aspnet-session-lost
-------------------------------------------------
//FIX disable AppDomain restart when deleting subdirectory
//This code will turn off monitoring from the root website directory.
//Monitoring of Bin, App_Themes and other folders will still be operational, so updated DLLs will still auto deploy.
System.Reflection.PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
object o = p.GetValue(null, null);
System.Reflection.FieldInfo f = o.GetType().GetField("_dirMonSubdirs", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.IgnoreCase);
object monitor = f.GetValue(o); //Returns NULL
System.Reflection.MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); m.Invoke(monitor, new object[] { });
------------------------------------------------
ไม่มีความคิดเห็น:
แสดงความคิดเห็น