I had this exact problem with my registrar. I believe that I am using dependency injection.
In my case, I was getting this error because I did not bind my registrar to the request area. Thus, he lived between requests and supported some of the HttpContext properties, but threw exceptions on those who spoke with IIS.
Since I'm using Ninject, it's just a matter of adding the InRequestScope() method from the Ninject.Web.Common namespace to my binding.
In short : this exception seems to be HttpContext for an obsolete HttpContext instance when it is accessed by certain properties that have been redirected to IIS and for which the request is no longer valid.
Hope this helps!
ps NLog is better than any logger you write. Or, if you just want exceptions, head over to ELMAH.
jkoreska
source share