|
-
October 11th, 2010, 10:03 AM
#1
Editing CSS or JS file restarts the application
Hi guys,
Sometimes (I believe it's completely random) the application is ended and restarted when I edit some CSS of JS file and refresh the browser (all localhost).
After logging the _shutDownMessage and _shutDownStack using the following code
Code:
HttpRuntime runtime = (HttpRuntime)typeof(System.Web.HttpRuntime).InvokeMember("_theRuntime", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.GetField, null, null, null);
if (runtime == null)
return;
string shutDownMessage = (string)runtime.GetType().InvokeMember("_shutDownMessage", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField, null, runtime, null);
string shutDownStack = (string)runtime.GetType().InvokeMember("_shutDownStack", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField, null, runtime, null);
//wirte to custom logger
Logger.Instance.Debug(string.Format("\r\n\r\n_shutDownMessage={0}\r\n\r\n_shutDownStack={1}", shutDownMessage, shutDownStack));
it results in the following log:
Code:
_shutDownMessage=Change in App_Offline.htm
HostingEnvironment initiated shutdown
Change in App_Offline.htm
Change in App_Offline.htm
Change in App_Offline.htm
HostingEnvironment caused shutdown
_shutDownStack= at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal()
at System.Web.Hosting.HostingEnvironment.InitiateShutdownWithoutDemand()
at System.Web.HttpRuntime.ShutdownAppDomain(String stackTrace)
at System.Web.HttpRuntime.ShutdownAppDomainWithStackTrace(ApplicationShutdownReason reason, String message, String stackTrace)
at System.Web.HttpRuntime.ShutdownAppDomain(ApplicationShutdownReason reason, String message)
at System.Web.HttpRuntime.OnAppOfflineFileChange(Object sender, FileChangeEvent e)
at System.Web.DirectoryMonitor.FireNotifications()
at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback)
at System.Web.Util.WorkItem.OnQueueUserWorkItemCompletion(Object state)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Any idea why editing a CSS or JS file results in a change of 'app_offline.htm'?
-
October 13th, 2010, 10:39 PM
#2
Re: Editing CSS or JS file restarts the application
Because you shut down ASP.Net. Hit Control-F5 to start it again.
-
October 14th, 2010, 02:40 AM
#3
Re: Editing CSS or JS file restarts the application
What do you mean with "shutdown ASP.Net"? I didn't stop it. While running I just edit some CSS or JS file inside VS2010.
And why does the application restart only sometimes?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|