refs:
https://blog.csdn.net/wangzl1163/article/details/73162826
https://docs.microsoft.com/zh-cn/dotnet/framework/configure-apps/file-schema/runtime/assemblybinding-element-for-runtime
https://www.cnblogs.com/s5689412/p/9825010.html
1)mongodb client加载到web项目,本地运行OK,发布时提示缺少依赖“System.Runtime.InteropServices.RuntimeInformation”
nuget安装依赖,依然无效。
使用本地web.config,OK,原来是webconfig中的runtime section影响的结果。
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.0.62.0" newVersion="1.0.62.0" /> </dependentAssembly>
.....................................
</runtime>
2)出现问题1的原因是多个版本dll的存在,程序不知选用哪个,需要指定,是否都兼容可用。