asp.net - 实体框架和 ApplicationIntent=READONLY
问题描述
我首先在 ASP.NET Framework v4.6.2 应用程序中使用 Entity Framework v6.4.4 数据库。这是我在 web.config 中的连接字符串条目:
<add name="MyApplicationEntities" connectionString="metadata=res://*/Models.MyApplication.csdl|res://*/Models.MyApplication.ssdl|res://*/Models.MyApplication.msl;provider=System.Data.SqlClient;provider connection string="data source=*****;MultiSubnetFailover=True;initial catalog=****;persist security info=True;ApplicationIntent=READONLY;user id=****;password=****;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
如果 ApplicationIntent=READONLY 在连接字符串中,那么当我尝试访问数据库时会出现异常:
The underlying provider failed on Open --> The wait operation timed out.
否则一切都很好。
我已经看到了这个答案 - https://stackoverflow.com/a/21241299/1471850 - 但这没有帮助。有谁知道问题可能是什么?
解决方案
推荐阅读
- c# - 从 Revit 加载项调用 Enity Framework 方法会导致 NotSupportedException
- php - Laravel 5.5 无法使用身份验证脚手架登录
- android - 当我想运行应用程序时,Android Studio 没有显示任何设备
- api - 如何通过 Ballerina 中的菜单驱动应用程序调用服务
- bash - Bash:如何在不使用 sed 或 awk 的情况下在 for 循环中获取文件的第 n 行
- java - 为什么在两个代码片段中的“@Override”注释都能正常工作?
- unix-timestamp - 在 Big Query 中创建包含来自 Unix 时间的日期和时间列的数据洞察报告表
- xamarin.forms - 我无法使用 SQL Operations Studio 连接到 SQL Server。天蓝色
- javascript - Firebase Web - forEach 与 limitToLast
- python - 键盘和弦代码的错误消息:termios.error: (25, 'Inappropriate ioctl for device')