当我尝试打开该网站时,我遇到了这个问题,但我不知道出了什么问题。
我已经用它编辑了堆栈跟踪
Server Error in '/' Application.
Request is not available in this context
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Request is not available in this context
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace
below.
Stack Trace:
[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpContext.get_Request() +8806688
labs.shared.config.CFGConstants.InitializeFromHttpContext() +42
labs.shared.config.CFGConstants..ctor() +722
labs.shared.config.CFGConstants.Get() +108
labs.site.framework.FWStateHelper.OnApplicationStart(HttpApplication app) +12
labs.site.Global.Application_Start(Object sender, EventArgs e) +5
[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +2724290
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +128
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +295
System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231
[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8909915
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333
你可能正在做一些事情Application_Start
事件处理程序。在 IIS 7 中,没有HttpRequest
那时可用,并且您不应该依赖于初始化应用程序的请求。
如果您确实需要在应用程序生命周期的早期请求内容,则需要捕获第一个请求。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)