Entity Framework 4 upgrade issue, Loading by both name and attribute is not allowed

ktm_4n

New Member
I just upgraded my project from asp.net 2 to asp.net 4. More precisely I converted the project from VS 2008 to VS 2010. I did this because I needed the new features of EF4. I am running into an issue though where I am getting this error message:\[quote\] The types in the assembly 'XXX' cannot be loaded because the assembly contains the EdmSchemaAttribute, and the closure of types is being loaded by name. Loading by both name and attribute is not allowed.\[/quote\]After some playing around I found that the cause is \[code\]context.GetObjectByKey\[/code\]. I had a little function that would take an object id and build an \[code\]EntityKey\[/code\] from it for use in \[code\]GetObjectByKey\[/code\]. If I change that to \[code\]context.ObjectName.FirstOrDefault(x => x.id == searchId)\[/code\] then I don't get the error anymore.I'm in the process of updating all my code to the version that works but I'm wondering if anybody knows the reason for this? Or does it indicates some underlying issue with my code; perhaps that my EDM got munged in the conversion?
 
Top