gpt4 book ai didi

c# - Entity Framework 中的属性重复和数据注释错误

转载 作者:行者123 更新时间:2023-12-02 10:45:08 26 4
gpt4 key购买 nike

我在VS2017的.NET Framework 4.7.1上运行了MVC5应用程序。

在构建应用程序时,出现错误。关于如何解决此问题有什么建议吗?

The type 'TableAttribute' 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'



Attribute error

project references

project references

project references

最佳答案

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

PM> update-package -reinstall

enter image description here

enter image description here

关于c# - Entity Framework 中的属性重复和数据注释错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50561469/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com