Entity Framework Duplicate type name within an assembly (6.1.0)

前端 未结 10 1748
臣服心动
臣服心动 2020-12-29 01:41

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

10条回答
  •  滥情空心
    2020-12-29 02:28

    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

提交回复
热议问题