VS2012转VB2019后程序集重映射警告问题求助
解决VS2019迁移后程序集版本冲突警告
原应用使用VS2012开发,迁移到VS2019并安装Microsoft.ReportingServices.ReportViewerControl.Winforms NuGet包后,构建时出现Microsoft.SqlServer.Types、EnvDTE、Microsoft.VisualStudio.GraphModel三个程序集的版本冲突警告,提示需要重映射版本。解决方法是修改项目的app.config文件,添加程序集版本重映射配置:
- 打开项目的
app.config文件 - 在
<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>
- 保存文件后重新构建项目,警告即可消除。
注意:如果原
app.config已有<runtime>节点,只需将<assemblyBinding>部分添加到现有<runtime>内部即可,无需重复创建<runtime>节点。
内容的提问来源于stack exchange,提问作者Larry Stinson
相关产品推荐
相关产品推荐

