简体   繁体   English

数据库中的更新模型未更新

[英]Update model from database is not updating

I am working on a solution with .edmx file 我正在使用.edmx文件解决方案

The environment is: 环境是:

  • VS 2013 VS 2013
  • Entity Framework 5.0.0.0 实体框架5.0.0.0
  • .Net version 4.0 (So actually EFW is 4.40) .Net 4.0版(因此EFW实际上是4.40)
  • SQL server 5.1 SQL Server 5.1
  • MySQL for VS 1.1.4 适用于VS 1.1.4的MySQL
  • MySQL Connector 6.4.4 MySQL连接器6.4.4

I have added a new field in a table that is already in the model, when trying to update the model from the database, it won't update actually, when prompted "Choose Your Database Objects and Settings", I can't expand the tables and views. 我在模型中已经存在的表中添加了一个新字段,当尝试从数据库中更新模型时,它实际上不会更新,当系统提示“选择数据库对象和设置”时,我无法展开表格和视图。

Any help will be appreciated. 任何帮助将不胜感激。

One thing I've noticed is that the EF model wizard won't appear if I'm using NuGet because NuGet pulls the latest version of all packages but my VS plugin was just installed once - there is no error when this happens; 我注意到的一件事是,如果我使用NuGet,则不会显示EF模型向导,因为NuGet会拉取所有软件包的最新版本,但我的VS插件仅安装一次-发生这种情况时没有错误; you get prompted for a connection and then no wizard appears. 您得到提示进行连接的提示,然后没有向导出现。 Here's the scenario: 这是场景:

  1. I'm using MySQL Connector version 6.6.3 that I installed with MySQL Server 我正在使用随MySQL服务器安装的MySQL Connector版本6.6.3
  2. NuGet updates my driver package in the project to 6.9.8 on build NuGet在构建时将项目中的驱动程序包更新为6.9.8
  3. Wizard stops working because 6.6.3 != 6.9.8 向导停止工作,因为6.6.3!= 6.9.8

To correct this I removed the MySQL references from NuGet and added them from my local machine. 为了解决这个问题,我从NuGet中删除了MySQL引用,并从本地计算机中添加了它们。 Now they are the same version as MySQL Connector and everything magically works again. 现在,它们的版本与MySQL Connector相同,并且一切都会神奇地恢复正常。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM