An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()'
错误提示
请求发生错误!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.An error occurred while updating the entries. See the inner exception for details.
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - 信号灯超时时间已到)
解决方案
C# 全选
builder.UseSqlServer(connection, x =>
{
x.UseNetTopologySuite();
//解决此问题:
//请求发生错误!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.An error occurred while updating the entries. See the inner exception for details.
//A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - 信号灯超时时间已到)
x.EnableRetryOnFailure(
maxRetryCount: 5,
maxRetryDelay: TimeSpan.FromSeconds(30),
errorNumbersToAdd: new int[] { 2 });
});
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网