I am working on an ASP.Net MVC 3 web application using EF 4.1. Since today, I am getting this error:
System.ArgumentException: Duplicate type name within an assembly
Ran into this issue today. I deleted all of my tables from the Entity Model .edmx
file, the updated my model from the Database (right-click --> update from database
).
Then I re-compiled and it ran fine. Such an odd error.
I am running MVC 4 and EF 5.0
I hade the same error.
I did clean solution rebuilt and it worked.
My solution was to turn off IIS and then start VS project again.
I ran into this error today, too. It turned out, that my data model has missing the foreign and primary key constraints in the data base. I had copied the original database to a local database to speed up the execution, but I had only copied the data and not the relationships. Other errors i had in this context were
an item with the same key has already been added
and
Unable to update the EntitySet Table because it has a DefiningQuery and no InsertFunction element exists in the ModificationFunctionMapping element to support the current operation
it all was due to a faultive database structure