Request is not available in this context exception. How to fix this error
Hello everybody.
Today i`ll tell you how to fix error: Request is not available in this context exception.
Few days ago, i deployed web application to the customer`s remote server and touched with the error: "Request is not available in this context exception". I can`t understand source of the problem. Because previous release was successful. It was really strange. Also i remember, that we have some problem with operation system installed on this machine. And our PM reinstall all environment from Windows Server 2003 to Windows Server 2008 with IIS7.
Reason of problem was in different version of IIS. The old server has IIS 6 and developers were using it. But with reinstalling Internet Information Services and upgrade it to new one, we faced with compatibility troubleshoot. So, what we should to do to fix this error without changing your code - change Application Pool Mode to Classic.
As you know,in IIS 7 we have to mode of application pool:
- Classic .NET mode
- Integrated mode
By default IIS7 uses Integrated Mode for running each application pool. The reason of problem was using HttpContext object in you Global.asax file. If you try to get access to HttpContext.Current variable (as in my case was), you will catch exception, that request has not available yet.
This is article might help you.
I hope i`ve helped you :-)
- Комментировать (войти)





