【发布时间】:2014-06-09 12:29:40
【问题描述】:
我们有一个代码优先的实体框架项目和一个关联的 app.config 文件。
连接字符串指向一个 SQL Azure 实例。当我们将应用程序部署到云服务中并要求它自动创建数据库时,它会这样做,但由于我们看到的是空表,因此似乎没有运行配置代码。
当我从托管在 Azure 中的 Dev VM 运行“update-database”时,我收到以下错误:
从 数据库。这可能是由于实体框架使用了不正确的 连接字符串。检查内部异常以获取详细信息并确保 连接字符串是正确的。
详细介绍
System.Data.Entity.Core.ProviderIncompatibleException: An error occurred while getting provider information from the database.
This can be caused by Entity Framework using an incorrect connection string.
Check the inner exceptions for details and ensure that the connection string is correct.
---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.
---> System.MissingMethodException: Method not found: 'System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher
但它与我们在部署实例中用于创建数据库的连接字符串相同。
关于 update-database 为何失败的任何建议?
【问题讨论】:
-
你是如何运行它的?有几种方法可以为迁移命令提供连接字符串
标签: entity-framework-5 entity-framework-migrations