【发布时间】:2014-06-20 12:11:04
【问题描述】:
当我从 Visual Studio 2013 启动 .NET 4.5 Web 应用程序时(但我不完全确定它仅限于这种情况),IIS 在启动应用程序时卡住了。如果我杀死w3wp.exe,它会自动重新启动并且应用程序运行正常。
当我将调试器附加到挂起的w3wp.exe 时,我得到下面的堆栈跟踪。只有一个名为 Worker thread 的托管线程,所有其他线程都在运行本机代码 - 因此目前没有任何自定义代码正在运行/休眠 - 只有这个。
mscorlib.dll!System.Threading.Thread.Sleep(int millisecondsTimeout)
System.Web.dll!System.Web.Hosting.PipelineRuntime.WaitForRequestsToDrain()
System.Web.dll!System.Web.HttpRuntime.Dispose()
System.Web.dll!System.Web.HttpRuntime.ReleaseResourcesAndUnloadAppDomain(object state)
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()
[Native to Managed Transition]
这可能是什么原因?
【问题讨论】: