c# - 如果 App 使用旧版本,如何在 DLL 中使用另一个版本的程序集
问题描述
我为应用程序(不是我的应用程序)开发了一个插件(WPF DLL)。我的插件使用 Newtonsoft.Json 和 Xceed.Wpf.Toolkit。一切正常。该应用程序的新版本现在带有这两个 DLL 的旧版本。经过多次搜索和尝试,我更改了应用程序的配置文件,如下所示:
原来的
...
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
...
新的
...
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
<codeBase version="12.0.0.0" href="custom\Newtonsoft.Json.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Xceed.Wpf.Toolkit" publicKeyToken="3e4669d2f30244f4" culture="neutral" />
<codeBase version="4.0.0.0" href="custom\Xceed.Wpf.Toolkit.dll" />
</dependentAssembly>
...
现在插件又开始工作了。但如果可能的话,我希望不要更改应用程序的配置文件。
除了这个还有其他可能吗?谢谢你。
解决方案
推荐阅读
- sql - 甲骨文 SQL | 提供 id 时,自动递增的 ID 不会递增
- django - Django Page Not Found / No Post 匹配给定的查询
- php - 规则错误的连接被拒绝和访问禁止,如何解决?
- google-apps-marketplace - 查找使用 C# 在 Sheets API 中创建的 google.sheet 文件
- swiftui - 如何在字体前面添加间距
- mongodb - 在 docker 容器中恢复 mongo 转储返回“失败:EOF”
- python - 如果满足条件,则在数据框中返回索引(日期)和列标题的方法
- discord.js - 在 nodejs [discord.js] 中从 args 运行 python
- arrays - 如何将 2 组数据合并到一个 UITableview 中
- c# - 我可以将泛型类与泛型方法一起使用吗?