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

.NET项目中System.Data.SqlClient程序集加载失败问题求助

.NET项目System.Data.SqlClient程序集版本不匹配问题

在Visual Studio的.NET项目中,每次启动程序都会提示找不到指定版本的System.Data.SqlClient程序集。添加请求的版本后,错误会再次出现,但要求的版本又发生变化。具体错误信息如下:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Data.SqlClient, Version=4.5.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'

该问题仅在从.NET Standard库调用.NET Framework函数时出现,已尝试以下解决步骤:

  • 检查项目依赖项:确认项目引用了正确版本的System.Data.SqlClient
  • 更新NuGet包:通过NuGet包管理器将所有包更新至最新版本
  • 清理并重建项目:使用Visual Studio中的Clean Solution和Rebuild Solution选项

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.20 17:17:32