You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.NET应用间歇性SQL连接异常:网络名称无法找到求助

间歇性SQL Server连接异常求助

我被一个间歇性问题困扰多年,目前已经没有可行的排查方向。有多台运行于Windows Server 2016 Standard v10.0.14393的.NET应用,会随机崩溃并抛出如下异常:

Unhandled exception. System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
 ---> System.ComponentModel.Win32Exception (67): The network name cannot be found.

这个异常的特殊点在于:

  • 连接字符串使用直接IP地址,而非主机名
  • 数据库服务器并未离线:报错后5秒内仍有10个其他应用正常访问该数据库

网上能找到的相关案例均为配置错误或服务器离线问题,完全匹配不上当前场景,想问问有没有人遇到过类似情况?

应用使用using包裹默认SqlConnection对象建立连接,连接字符串如下:

uid=username;password=password;server=ip;connection timeout=30;database=db;max pool size=100;

内容的提问来源于stack exchange,提问作者Jeax

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 14:46:01