I want to use a new version of log4net with nhibernate. The log4net version is compiled by myself from the svn source so I had to sign it with a new key which means the publicKeyToken is changed. I also set the version to 1.2.11.0 . The problem is that nhibernate references the old 1.2.10.0 version of log4net.
I tried to configure the assembly binding redirection with this part in app开发者_如何学JAVA.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net"
publicKeyToken="1b44e1d426115821"/>
<bindingRedirect oldVersion="1.2.10.0"
newVersion="1.2.11.0"/>
</dependentAssembly>
</assemblyBinding>
However it doesn't seem to have any effect. I assume it is because the publicKeyToken doesn't match.
Is there any other way to do this or do I: a. Use log4net 1.2.10 and create a log4net extensions project with the additions and fixes from the svn codebase that I'm interested in? OR b. Build my own version of nhibernate using my own log4net build OR c. Make the log4net team release a new version of log4net with the correct publicKeyToken
I would prefer c. and honestly I can't understand why they haven't released a new build version in ages, there are a lot of fixes and new functionality in the svn source.
What you want is exactly what signing aims to prevent.
Note that your option c) also requires a new Hibernate build.
I think that b) is your best shot.
精彩评论