I upgraded project from .net 4.0 to .net 4.5.1.
and I upgraded EntityFramework from 4.3.1 to 6.1.3.
But EntityFramework based on .net 4.0 (\packages\EntityFramework.6.1.3\lib\net40\EntityFramework) because another depended project running .net 4.0.
When I build, I got this error:
The type 'ForeignKeyAttribute' exists in both 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Thanks in advance.
using System.ComponentModel.DataAnnotations;from your code. - Ivan Stoevusing System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema;And both attributes are coming fromAssembly System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Looks like something is wrong withEntityFrameworkassembly in your scenario, have no idea how it can be resolved. Good luck. - Ivan Stoev