Schema specified is not valid. Errors: Multiple types with the name

asp.net-mvc c# entity-framework-6 sql-server-2008

Question

I am working in EF 6 and facing the following issue when I try run my project.

Schema specified is not valid. Errors:

Multiple types with the name 'TableName' exist in the EdmItemCollection in different namespaces. Convention based mapping requires unique names without regard to namespace in the EdmItemCollection.

I tried too much on StackOverFlow and google and found no solution. I am using visual studio 2012. I crated a single .edmx file for whole of my database. I searched the tableName throughout the project and there is single occurrence of table.

Please help me in this regard

1
4
8/21/2015 2:39:27 PM

Accepted Answer

Finally I figured out the solution of the problem. In my question above, I stated that I have only single edmx file in my project. It is true in one sense. But wrong in the other sense.

I am using git to manage my code. I created another edmx file in another project and used that project's reference in my main project.

Then I switched git branch with dll in .gitignore. Those dlls which were in .gitignore could not be replaced by git with the newly switched branch's dlls. So I had two references of edmx files in my project with fully built dlls.

Problem solved when I keenly checked my bin folder and removed the dll which was actually not belonging to the current git branch.

I hope it will help you. Comment here if some thing is not clear. Thanks

6
8/21/2015 4:37:00 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow