I am building an ASP.Net MVC 3 web application using Entity Framework 4.1 with the Database First Approach.
I have just setup my solution with separate projects for the following:
- UI - MVC app
- Model - Class Library
- POCOs - Class Library
- Repositories - Class Library
- Services - Class Library
I have set this up a few times before without any trouble, but now when I try to create a controller in my MVC app, I get the following error:
Unable to retrieve metadata for 'Entityname'. An item with the same key has already been added.
This happens when I try to add any controller with an Entity for its Model class. I am stumped with this. I tried re-creating the model from the db and regenerated my POCO classes, but still this problem exists.
Can anyone please help?
Thanks.