类型' MaxLengthAttribute'存在于' EntityFramework和' System.ComponentModel.DataAnnotations中

时间:2017-02-20 13:55:04

标签: entity-framework asp.net-web-api data-annotations

我正在传统的Web Api 2项目(目标4.5)上进行一些春季清洁工作。作为nuget更新的一部分,我将Microsoft.AspNet.WebApi.HelpPage从5.0.0版移至5.2.3版。一旦我这样做,我收到以下消息:

  

错误CS0433类型' MaxLengthAttribute'存在于两者中   ' EntityFramework,Version = 6.0.0.0,Culture = neutral,   公钥= b77a5c561934e089'和   ' System.ComponentModel.DataAnnotations,Version = 4.0.0.0,   Culture = neutral,PublicKeyToken = 31bf3856ad364e35'

当他们将该类从EF移到DataAnnotations并且解决方案是升级EF时,看起来这是一个问题。由于我有EF(5.2.3)的最新稳定版本,我不知道还能做什么。我尝试从using语句中删除System.ComponentModel.DataAnnotations,但它没有获取EF MaxLengthAttribute。清理和重建解决方案也不起作用。

任何指针都表示赞赏。

0 个答案:

没有答案