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

无法加载Microsoft.SqlServer.ConnectionInfo程序集,SQL Server2019+SSMS18求解决

问题分析与解决

这是SMO(SQL Server Management Objects)版本不匹配导致的问题。你当前使用的SQL Server 2019和SSMS 18对应的是15.x版本的SMO组件,但你的程序依赖的是13.0版本(对应SQL Server 2016)的Microsoft.SqlServer.ConnectionInfo,系统自然找不到指定版本的文件。

以下是具体解决步骤:

  • 添加绑定重定向(优先推荐)
    若程序允许兼容更高版本SMO,可修改应用配置文件(app.config/web.config),添加版本绑定重定向,让程序自动使用现有15.x版本组件替代13.0版本:

    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.SqlServer.ConnectionInfo" publicKeyToken="89845dcd8080cc91" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    
  • 安装对应版本的SMO组件(若必须用13.0版本)
    若无法修改程序依赖,需安装SQL Server 2016的SMO组件:

    • 下载SQL Server 2016 Feature Pack,找到并安装Microsoft SQL Server 2016 Management Objects包;
    • 安装完成后,Microsoft.SqlServer.ConnectionInfo.dll会被放置在C:\Program Files\Microsoft SQL Server\130\SDK\Assemblies路径下。
  • 确认SSMS的SMO组件位置
    SSMS 18的SMO组件不在SQL Server的SDK文件夹中,而是存放在SSMS安装目录(示例路径:C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\CommonExtensions\Microsoft\SqlServer\Management),可在此处找到15.x版本的目标DLL,确认组件存在。

  • 修正程序引用(针对开发场景)
    若为自行开发的程序,检查项目中Microsoft.SqlServer.ConnectionInfo的引用版本,将其更新为当前环境存在的15.x版本,并调整引用路径到SSMS或SQL Server 2019对应的组件目录。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.10 23:24:59