I am not sure what is going on but I keep getting the following exception when doing a query. \"Duplicate type name within an assembly.\" I have not been able to find a solu
Had same issue that has taken hours yesterday to get rid of. Using EF 6.1.0, error on executing linq to entities query similar as above. My solution was to stop IIS Express, clean solution , uninstall EF from all projects in solution, close VS2012, delete all packages folders/files within solution, then restart VS2012, add EF 6.1.0 where needed, compile, error disappeared.
With EF 6.1, I run into the same problem.
In my case, my model has a self-reference table. So I found it might be caused by the following two reasons.
Faced the same in my WCF webservice
recently. Just clean your solution and rebuild it. This should fix the issue.
None of the above seem to work for me however in the link specified earlier i did fin this, which worked for me. This was submitted by 'bunomonteiro'
To Fix "Duplicate type name within an assembly"
I had similar issue. I checked all my models/classes and I have not used duplicate names for types. I deleted the assemblies and regenerated the the model and context object from the database and still had the same issue.
A trace yielded in Visual Studio "Children could not be evaluated". The SOLUTION is to add .ToList(); or ToArray(); or ToDictionary() etc, to your query. etc.
eg. var query = context.TableName.Where(x => x.name =="CodeRealm").ToList();
PingBack - http://entityframework.codeplex.com/workitem/1898
bunomonteiro wrote Jul 18 at 3:37 AM