This project is read-only.

Failing to create instance of System.Web.HttpContextBase

Topics: General
Sep 4, 2015 at 8:09 PM
Edited Sep 6, 2015 at 10:30 PM
I'm working on a site that's running Orchard version 1.7.2 and ever since I upgraded my machine to Windows 10 (or maybe it was installing VS 2015 - did both at about the same time) when I run the site locally (using VS2013) or build the site and deploy it to a server, I get the following error on background tasks:
A delegate registered to create instances of 'System.Web.HttpContextBase' returned null.
It's the same error reported here: but I'm running an old version (1.7.2). I know I should upgrade (and will) but need to get past this for now.

I cannot seem to figure out what's going on here. Am I missing something that used to be in the GAC and isn't after my upgrade? I'd appreciate any suggestions on what I should be looking at to resolve the issue.


The error has mysteriously disappeared when debugging locally in VS2013. However, my precompiled builds (done with VS2013 developer command prompt) are still exhibiting the issue when deployed to our test server. I did find a reference to what appears to be the exact same issue here:

In that posters case, he cherry picked the updates from the 1.9.1 fix to get things working. I'm very hesitant to do that due to fear of unintended consequences of those changes on 1.7.2. If anyone has any suggestions I would very much appreciate them. It seems this has to be some sort of configuration issue on my machine since the Orchard source code has not changed at all while new builds have the error.
Sep 7, 2015 at 2:37 AM
Turns out this was just a stupid mistake on my part. I had accidentally ran the build script using VS2015 command prompt a few days ago and needed to do a git clean to get rid of all the invalid dlls. Once I did that everything worked fine.