我无法使网站正常工作,在本地工作正常,但一旦我进行网络部署,我就会收到以下错误。
异常详细信息:System.Web.HttpException:请求在此上下文中不可用
堆栈追踪:
[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +12964837
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12968244
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12807949
App_start:
protected void Application_Start(object sender, EventArgs e)
{
MvcHandler.DisableMvcResponseHeader = true;
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}
该网站位于其自己的应用程序池中,我还将应用程序池从集成更改为经典。 Applicatiun正在运行等......
我在最近几个小时里不知疲倦地搜索,没有一项研究回答过这个问题,我仍然无法提出解决方案,有没有人有任何想法?
在经典模式下,我得到一个"此操作需要IIS集成管道模式。"错误。
答案 0 :(得分:2)
好的,事实证明,与应用程序启动时数据库表相关的问题是加载客户端和角色操作。其中一个表上存在未命中匹配,因此应用程序抛出异常。
在开发数据库上的表格很好,但是在测试数据库上表有上面的问题,这就是为什么一开始很难捕获,但是当我将开发中的连接字符串从开发数据库指向测试数据库我能够捕获并解决问题。
感谢您的回复。