System.ArgumentException: Duplicate type name within an assembly

后端 未结 4 1395
囚心锁ツ
囚心锁ツ 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 15:48

    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

    0 讨论(0)
  • 2021-02-13 15:54

    I hade the same error.

    I did clean solution rebuilt and it worked.

    0 讨论(0)
  • 2021-02-13 15:55

    My solution was to turn off IIS and then start VS project again.

    IIS shutdown

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题