I have encountered an exception when I use Entity Framework 4.0 RC.
My Entity Framework model is encapsulated in a private assembly who\'s name is Procurement.EFDataProvider
My problem was I had edited the T4 template to exclude the replication field named "msrepl_tran_version". This caused the database to not match the generated classes which can causes this error message. Just make sure your database and classes match.