背景
最近在使用EFCore去连接阿里云上面的数据库进行开发的时候,当自己在Debug模式下总是提示下面的报错信息,然后找了好久都没有解决,报错信息如下:
an exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseSqlServer' call.
---> System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - 信号灯超时时间已到)
---> System.ComponentModel.Win32Exception: 信号灯超时时间已到
而且这个在连接到本地数据库的时候没有出现过这个问题,所以初步确定是由于连接到阿里云上面的数据库时候,由于一些网络问题造成在调试状态下出现这个问题,那么到底该进行怎样的配置才能够解决这个问题呢?最近经过多方努力找到了这个问题的解决方案,先来看看是如何解决的。
<