实体框架和数据注释错误中的重复属性

问题描述 投票:0回答:1

我在VS2017中的.NET framework 4.7.1上运行了一个MVC5应用程序。

当我构建我的应用程序时,我遇到了错误。有关如何解决此问题的任何建议?

类型'TableAttribute'存在于'EntityFramework,Version = 6.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'和'System.ComponentModel.DataAnnotations,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'

Attribute error

project references

project references

project references

c# asp.net-mvc-5 compiler-errors .net-framework-version
1个回答
1
投票

从引用列表中删除“System.ComponentModel.DataAnnotations”删除数据注释使用的所有属性,如[Key],[StringLength] ..也运行

PM> update-package -reinstall

enter image description here

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.