I am working on an asp.net application which errors only during the first time running the app. The error message is {“Response is not available in this context.”} and the app breaks in the global.asax.cs page in Application_Error function.
The stack trace value is: at System.Web.HttpApplication.get_Response()
at pcMDnet.Global.Application_Error(Object sender, EventArgs e) in C:\BuildDir\1.0.1.05\GIS\pcMDnet\Global.asax.cs:line 364
at System.Web.HttpApplication.RaiseOnError()
How can I debug this issue?
This error is due to a design change in the IIS7 Integrated pipeline that makes the request context unavailable in Application_Start event.
To solve it ether remove the reference on the content at that point, or make one time initialization on
Application_BeginRequestwhere the content exist.reference: http://mvolo.com/iis7-integrated-mode-request-is-not-available-in-this-context-exception-in-applicationstart