0

i have class like the following

public class Privilege 
{

    [ForeignKey("User")] // error line
    public int? UserId { get; set; }


    ....
}

everything was fine until i change the target framework of the project. it was .Net 4.0 and i changed it to 4.5

now there is an error for ForeignKey("User") part.

The type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedAttribute' exists in both 'c:....\packages\EntityFramework.6.1.1\lib\net40\EntityFramework.dll' and 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll'

how should i solve this issue?

by the way as you can easily understand i m using entity framework in my project and its version 6.1.1

brtb
  • 2,201
  • 6
  • 34
  • 53
  • 4
    This question was [answered before on SO](http://stackoverflow.com/a/17791989/997668). – Michael Nov 07 '14 at 10:33
  • 1
    possible duplicate of [Type definition exists in two libraries](http://stackoverflow.com/questions/17791930/type-definition-exists-in-two-libraries) – thumbmunkeys Nov 07 '14 at 10:36

0 Answers0