System.ArgumentException: Duplicate type name within an assembly

后端 未结 4 1415
囚心锁ツ
囚心锁ツ 2021-02-13 15:18

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

4条回答
  •  我寻月下人不归
    2021-02-13 16:02

    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

提交回复
热议问题