How to debug System.TypeLoadException errors in .NET?
I received this error after refactoring. I had two projects compiling to DLLs with the same name.
Check the "Assembly name" in the project's properties' "Application" section.
The problem is that you have a mismatch in your versions. Make sure all your assemblies are compiled for .NET 4.