I also had this error but the class was actually a data contract. After lots of compiling, restarting and CIL compiling to no avail. I found the class mentioned, found the root class in the inheritance hierarchy and compiled foreward from that class. Did a full CIL and it worked.