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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With