響應在此上下文中不可用。 我該如何解決這個問題,我需要一些幫助,請 我試圖解決這個問題,但我不能 的網站能正常工作在我的本地主機上,但是當我把它上傳到主機上不起作用 人幫助我,請'/'應用程序中的服務器錯誤4
{
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
}
你高估了我們閱讀你的思維的能力。 –
附加代碼,提供有關您的頁面的更多信息,嘗試更多地解釋您的問題 – wudzik
可能存在不同的場景,請考慮部署環境並共享您的代碼。如果可能的話,通過引入try catch塊並寫入文件並將其發送到生產環境來修改代碼。 – kbvishnu