项目中有一些Task,从某个时段起开始报以下异常。具体如下:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=1064; handshake=0; ---> System.ComponentModel.Win32Exception: The wait operation timed out ---
从异常信息看,是在于sql进行连接时出现超时,具体的猜测为:握手协议失败。
不知道有无朋友遇到过此问题。
很明显是数据库都没连接上吧
看看EF是怎么写的咯,代码也没一行,瞎猜是不对的。