问题描述
这是一个 ASP.NET(Framework v. 4.5.2)网站,目前在生产环境中可靠运行。一项新要求要求向已完成的现有 sql Server 表 (apProduct) 添加新列。然后我对 .edmx 文件、控制器、视图等进行了必要的更改,一切都编译正常。但是,我现在收到以下运行时错误:
当我调试并在第一次创建 apDepartment 的地方设置断点时,我展开创建的对象并看到:
我注意到:“‘EntityFrameworkDynamicProxies-AnkoMVC’的元数据无效。”
这里是定义 apProduct 的地方,很明显在 AnkoMVC.Models 命名空间中:
最后,这里是 DbContext 类:
谁能提供有关如何克服这个问题的建议?