【发布时间】:2012-09-04 19:27:59
【问题描述】:
在本地调试 VS2010 中的 Web 应用程序时,我看到一些非常奇怪的行为。相同的用户旅程/页面序列发生在生产环境中。
正在调试,我看到了这个:
1. request for MyPage.aspx - handled by thread_1
2. (there is something on that page that IIS/ASP.Net doesn't like it seems) I'm slowly removing sections to pin-point exactly but there's
no JS, or anything fancy there just html content, user controls etc.
3. Either way a separate thread_2 to begin processing the Page_Load of my defaultdocument i.e. home.aspx is executed. There is logic in
home.aspx.cs to clear some data.
4. So when thread_1 continues processing, checks against the data above fail, resulting with the user being redirected to an error page.
谁能解释为什么创建第二个线程以及为什么它开始处理我的默认文档?
请注意:
- 我检查了全局方法是否有错误,例如会话结束, app_error 等但没有。
- 我在启用失败请求跟踪日志的情况下间歇性看到 401 错误,但我不明白这将如何启动 正在处理我的默认主页?
- 为了进行完整性检查,我在 web.config 中我的默认文档列表的开头放置了一个新的文档 test.aspx,它确实被调用了。
似乎 IIS/ASP.Net 中的某些内容被配置为在出现错误时开始处理默认页面,但这对我来说是新行为?
我已经尝试对此进行研究,但似乎唯一可能与之相关的是线程敏捷性,但我不太确定..?
【问题讨论】:
-
您如何准确识别这些线程?你是用 iis express 调试的吗?它通常都在一个线程上执行。
-
VS2010 中的线程视图显示具有不同 id 的单独线程。
-
您的问题不清楚。您的 home.aspx page_load 是否执行了两次?您是否正在跳过默认文档?有重定向吗?需要更多信息/代码。
-
请阅读数字。用户正在浏览该站点并到达有问题的 MyPage。在那个页面的处理过程中,程序流执行被转移到home.aspx?如果您经历过这种将执行更改为通过默认文档运行的单独线程的更改,请告知?没有重定向。是这种奇怪的行为跳转到主页我需要有经验的人帮忙吗?
标签: c# asp.net multithreading iis-7 default-document