Juan Pablo Gomez
Juan Pablo Gomez

Reputation: 5544

Problems with EF version after move project

After move my Project vs2010 ef 4 to vs 2012 ef5 , appear on my Project some problems with DataAnnotations on the models

[ForeignKey("StrIdDocumento")]

Can't find type or space name 'ForeignKey' [Lost using directive or assembly reference]

I remove the reference to EF 4, then add EF5 using nugget. But the problem persists

Note: My Project is an MVC with c# and ASP.

Upvotes: 0

Views: 41

Answers (1)

origin1tech
origin1tech

Reputation: 749

Likely missing this using statement.

using System.ComponentModel.DataAnnotations.Schema;

you may want to look into using the fluent api also instead of data annotations, just a thought.

Upvotes: 1

Related Questions