我正在使用Apache的log4net版本来记录东西
1.2.10.0 (with PublicTokenKey=1b44e1d426115821)
但遗憾的是,SAP Crystal Reports使用自己的此库版本和另一个公共令牌密钥(使用自己的snk文件编译):
1.2.10.0 (with PublicTokenKey=692fbea5521e1304)
相同版本,不同的公共令牌密钥。当我编译我的解决方案时,我有一条消息告诉我以下内容:
“无法解决”log4net,Version = 1.2.10.0,Culture = neutral,PublicKeyToken = 1b44e1d426115821“和”log4net,Version = 1.2.10.0,Culture = neutral,PublicKeyToken = 692fbea5521e1304“之间的冲突。 “log4net,Version = 1.2.10.0,Culture = neutral,PublicKeyToken = 1b44e1d426115821”任意。“
最糟糕的是,如果不安装32位版本的Crystal Reports(在GAC上安装log4net程序集),我就无法部署到64位计算机上。
我从GAC获取了Crystal版本的log4net,问题是:
如果我开始使用Crystal Reports的版本(PublicTokenKey = 692fbea5521e1304),我会解决任何问题吗?
和 如果我想使用log4net的下一个版本(比如v1.2.11.0)怎么办?
有没有办法以正确的方式解决这个问题?
答案 0 :(得分:0)
答案 1 :(得分:0)
将此代码添加到App.config中:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304"/>
<bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304"/>
<bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304"/>
<bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304"/>
<bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Enterprise.Framework" publicKeyToken="692fbea5521e1304"/>
<bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.1100.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Enterprise.InfoStore" publicKeyToken="692fbea5521e1304"/>
<bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.1100.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>