I’m writing this post for myself, so everyone else can stop reading now if you like. Although you might find it useful, who knows.
Why am I talking to myself? Because today I came across the error in the title, and thought “Hmm I’ve not seen that one before”, only to plug it into Google and to have my browser tell me I’d already visited the first 5 results for that search previously.
Increasing age, you’re a cruel mistress.
None of those results applied to my situation at all, and I’m hoping that writing this post will save me some time in future, so here goes.
This issue can also occur when you’ve upgraded a site (usually running a product), and have some old DLLs lying around. In this case, some refactoring had occurred to the product, and there was an old DLL lurking around that was causing the error above under certain situations. So the solution was simply to look closely, clean up the references and bin directories, and then all is well.
Ross, if you’re reading this in the future, then you really should consider investing in some memory exercises, or, to take more care with those product upgrades. Seriously.