发生原因:程序引用了2个log4net程序集,有部分功能必须指定版本所以导致此问题。试了重定向到高版本也不行,最后找到的解决办法 在web.config runtime>assemblyBinding下添加下面节点解决。添加2个log4net.dll的路径和版本信息,程序会自动去关联对应版本的log4net.dll
<dependentAssembly> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" Culture="neutral"/> <bindingRedirect oldVersion="1.2.13.0" newVersion="2.0.8.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" /> <publisherPolicy apply="no" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" /> <codeBase version="1.2.13.0" href="DLL\log4net.dll" /> <codeBase version="2.0.8.0" href="DLL\2\log4net.dll" /> </dependentAssembly>