I am getting exactly the same error after migration (WebApplication to WebSite) but with a user control.
Any News?
Cheers,
I got my error solved changig the attribute CodeBehind into CodeFile, but, thus I hope so, I don't know if it's your case.