Entity Framework and the "Undefined column mapping" Exception

I've recently run across an exception that occurs while trying to update Entity Framework data models from their respective databases. The exception message is "Unable to generate the model because of the following exception: 'An error occurred while executing the command definition. See the inner exception for details. Undefined column mapping."

I searched online and couldn't find any mention of this exception. This surprised me, considering the frequency with which I've been encountering it. I thought that perhaps it had something to do with the DbContext I'm using with Entity Framework 4.1 to create persistence ignorant POCO (plain old CLR object) classes. I tried a few things to alleviate the issue, but to no avail.

As of now, the only solution I have to this problem is merely a workaround: delete all of the entities from the model and re-add them. I hope to eventually find a good solution to this problem, but with limited time and no other leads to go by, this is the best I could come up with for now. I hope it helps someone out. I know it's not an ideal solution (especially if you've got a lot of entities in your data model) but for now, this is the best I could come up with. If anyone else has a better workaround or a solution, please share it.

Comments

Popular Posts

Resolving the "n timer(s) still in the queue" Error In Angular Unit Tests

Silent Renew and the "login_required" Error When Using oidc-client

How to Get Norton Security Suite Firewall to Allow Remote Desktop Connections in Windows

Fixing the "Please add a @Pipe/@Directive/@Component annotation" Error In An Angular App After Upgrading to webpack 4

How to Determine if a Column Exists in a DataReader