【发布时间】:2013-07-18 06:10:54
【问题描述】:
响应在此上下文中不可用。 我该如何解决这个问题我需要一些帮助 我试图解决它,但我不能 该网站在我的本地主机上正常工作,但是当我将其上传到主机时它不起作用 有人请帮帮我
{
Response 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: Response 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): Response is not available in this context.]
System.Web.HttpContext.get_Response() +8820296
ASP.global_asax.Application_Start(Object sender, EventArgs e) +54
[HttpException (0x80004005): Response is not available in this context.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +2731054
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): Response is not available in this context.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8929163
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333
}
【问题讨论】:
-
你高估了我们读心的能力。
-
附加代码,提供更多关于你的页面的信息,多尝试解释你的问题
-
可能会有不同的场景,只需考虑部署环境并分享您的代码。如果可能,通过引入 try catch 块来修改代码并写入文件并将其发送到生产环境
-
@MichaelPerrenoud 这里没有证据可以这么说。问题没有提供任何适当的信息。
-
@VeeKayBee,请注意系统在识别重复项时自动生成的文本 - 可能重复。此外,如果它在本地工作,但在部署时不能工作,那么显然存在围绕 Web 服务器配置的问题。我发现 Darin 的答案是配置网站时非常常见的错误。很简单。