Asp.net 如果没有应用程序启动,请求在此上下文中不可用

Asp.net 如果没有应用程序启动,请求在此上下文中不可用,asp.net,iis-7,Asp.net,Iis 7,我正在更改使用Framework 2.0创建的旧ASP.NET应用程序。 Global.asax没有启动应用程序,但是当我在IIS7上调试时,我得到了一个错误 描述:执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源 异常详细信息:System.Web.HttpException:请求在此上下文中不可用 源错误: 在执行当前web请求期间生成了未经处理的异常。有关异常的起源和位置的信息可以使用下面的异常堆栈跟踪来识别 堆栈跟踪: [HttpExc

我正在更改使用Framework 2.0创建的旧ASP.NET应用程序。 Global.asax没有启动应用程序,但是当我在IIS7上调试时,我得到了一个错误

描述:执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源

异常详细信息:System.Web.HttpException:请求在此上下文中不可用

源错误:

在执行当前web请求期间生成了未经处理的异常。有关异常的起源和位置的信息可以使用下面的异常堆栈跟踪来识别

堆栈跟踪:

[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpContext.get_Request() +11207688
Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.GetConfiguration(String 
configFilePath) +130
Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.PopulateSection  
(ModulesConfigurationSection section, String rootDirectory) +274
Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.GetModuleConfigurationSection
() +103
Microsoft.Practices.CompositeWeb.Services.WebModuleEnumerator.EnumerateModules() +216
Microsoft.Practices.CompositeWeb.WebClientApplication.LoadModules() +443
Microsoft.Practices.CompositeWeb.WebClientApplication.Application_Start(Object sender,   
EventArgs e) +262

[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext  
context, HttpApplication app) +4185553
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, 
HttpContext context, MethodInfo[] handlers) +205
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr 
appContext, HttpContext context) +336
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext,
HttpContext context) +350
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +382

[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11335894
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,
HttpContext context) +4355316

当我切换到VS的Web服务器部分进行开发时,我没有遇到任何错误,一切正常。有什么想法吗?

看来PnP的人在他们的设计中忽略了这一点:


这里有一个可能的解决方法:

可能重复一次全局。asax只包含应用程序错误,其他什么都不包含SEALEX,你在哪里能找到这个问题?@AlexKu,你就是这家伙吗。。。你有解决办法吗