gpt4 book ai didi

entity-framework - 应用程序配置文件中的连接字符串不包含所需的providerName属性

转载 作者:行者123 更新时间:2023-12-04 07:24:44 24 4
gpt4 key购买 nike

我在 Azure 中有一个 WorkerRole,它连接到 MSSQL 数据库(也在 Azure 中,在其自己的虚拟机上 - 换句话说,不是 Azure SQL 数据库)。 WorkerRole 使用 EntityFramework(代码优先)。

我的连接字符串如下所示,来自辅助角色的连接在我的开发环境中工作得很好:

<add name="MyConnectionString" connectionString="Data Source=mydatabaseserver.cloudapp.net;Initial Catalog=MyDatabase;User ID=MyUser;Password=ThePassword;" providerName="System.Data.SqlClient" />

但是,应用程序抛出错误:

The connection string MyConnectionString in the application's configuration file does not contain the required providerName attribute

正如您所看到的,它显然包含providerName 属性。我已检查 obj/Release 文件夹以查看发布到 Azure 的实际配置文件,它也包含该属性。

我做错了什么?

最佳答案

没关系。事实上它现在正在工作。

我认为它不起作用的原因是 Azure 将跟踪数据写入 TableStorage 的方式存在延迟。这让我相信 WorkerRole 在更新连接字符串后仍然抛出错误,尽管事实并非如此。

关于entity-framework - 应用程序配置文件中的连接字符串不包含所需的providerName属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26548525/

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