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

VS2012转VB2019后程序集重映射警告问题求助

解决VS2019迁移后程序集版本冲突警告

原应用使用VS2012开发,迁移到VS2019并安装Microsoft.ReportingServices.ReportViewerControl.Winforms NuGet包后,构建时出现Microsoft.SqlServer.Types、EnvDTE、Microsoft.VisualStudio.GraphModel三个程序集的版本冲突警告,提示需要重映射版本。解决方法是修改项目的app.config文件,添加程序集版本重映射配置:

  1. 打开项目的app.config文件
  2. 在<configuration>节点内部,添加<runtime>节点及对应程序集的版本重映射规则,具体代码如下:
<configuration>
  <!-- 保留原有的app.config内容 -->
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <!-- Microsoft.SqlServer.Types 版本映射 -->
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
        <bindingRedirect oldVersion="12.0.0.0" newVersion="14.0.0.0" />
      </dependentAssembly>
      <!-- EnvDTE 版本映射 -->
      <dependentAssembly>
        <assemblyIdentity name="EnvDTE" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="7.0.3300.0" newVersion="8.0.0.0" />
      </dependentAssembly>
      <!-- Microsoft.VisualStudio.GraphModel 版本映射 -->
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualStudio.GraphModel" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="11.0.0.0" newVersion="14.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
  1. 保存文件后重新构建项目,警告即可消除。

注意:如果原app.config已有<runtime>节点,只需将<assemblyBinding>部分添加到现有<runtime>内部即可,无需重复创建<runtime>节点。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.16 10:42:26