“bin dir 更改或目录重命名”的原因应用程序重新启动? (我认为已修复)
更新/修复
好吧,我做了两件事,似乎有效
- 更改了我的应用程序池的高级设置>>>流程模型>> “网络服务”的身份
- 指示它使用临时文件夹在站点 .net 编译设置上进行编译。仍然会每隔一段时间重新启动一次,但会话不会丢失,并且所有浏览器仍然可以连接。
我正在 asp.net 4 中构建我的 Web 应用程序,并且很难弄清楚为什么我的连接在大约一分钟后超时(当浏览到 - 使用 IIS 7 托管时)。我被告知这可能是由于 web.config/directory 被编辑,因此应用程序被卸载/重新启动并且页面消失。我不知道我编写的任何代码明确地编辑了垃圾箱上的任何内容。
我正在连接到 sql(通过表适配器或 SQLConnection 类),但我认为这不会做任何事情。我还使用作为脚本运行的按钮。
我已在 IIS 中将配置更改选项重新启动设置为 false,但仍然无济于事。
编辑
以下是关闭的一些事件日志。
_shutDownMessage=Change Notification for critical directories.
bin dir change or directory rename
HostingEnvironment initiated shutdown
HostingEnvironment caused shutdown
Change Notification for critical directories.
bin dir change or directory rename
Change Notification for critical directories.
bin dir change or directory rename
Change Notification for critical directories.
bin dir change or directory rename
_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.OnCriticalDirectoryChange(Object sender, FileChangeEvent e)
at System.Web.FileChangesMonitor.OnCriticaldirChange(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()
我一直在绞尽脑汁地思考为什么 bin 会被改变。完全不知所措,我们写的任何内容都不会故意在其中写入任何内容/更改任何内容
Update / FIX
Well I did two things which seemed to have it work
- Changed my app pool's Advanced settings >> Process Model>> identity to "Network Service"
- Directed it to use a temp folder for compilation on the sites .net compilation settings. There is still a restart every once in a while but the session doesn't get lost, and all browsers can still connect.
This also worked: http://www.aaronblake.co.uk/blog/2009/09/28/bug-fix-application-restarts-on-directory-delete-in-asp-net/
I am building my web app in asp.net 4 and am having much trouble figuring out why my connection is timing out after about a minute (when browsed to - hosted using IIS 7). I have been informed that this is probably due to the web.config/directory being edited, and therefore the app being unloaded/restarted and the page dies. I am not aware of any code I wrote explicitly editing anything on the bin.
I am connecting to sql (through table adapters or SQLConnection Class) but I don't think that would do anything. Also I am using buttons which run as scripts.
I have set the restart on config change option to false in IIS with no avail still..
EDIT
Here are some event logs of the shutdown.
_shutDownMessage=Change Notification for critical directories.
bin dir change or directory rename
HostingEnvironment initiated shutdown
HostingEnvironment caused shutdown
Change Notification for critical directories.
bin dir change or directory rename
Change Notification for critical directories.
bin dir change or directory rename
Change Notification for critical directories.
bin dir change or directory rename
_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.OnCriticalDirectoryChange(Object sender, FileChangeEvent e)
at System.Web.FileChangesMonitor.OnCriticaldirChange(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()
Have been straining my brain thinking of why bin would be getting changed. at a complete loss, nothing we wrote writes anything/changes anything in there knowingly
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论