Use a different version of the assembly with the new publicKeyToken when the third-party library depends on the old version

I want to use the new version of log4net with nhibernate. The log4net version was compiled by me from the svn source, so I had to sign it with a new key, which means that publicKeyToken was changed. I also installed the version in 1.2.11.0. The problem is that nhibernate is referencing the old version of log4net version 1.2.10.0.

I tried to configure assembly binding redirection using this part in app.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, this does not seem to have any effect. I assume this is because publicKeyToken is not consistent.

Is there any other way to do this or to do this: a. Use log4net 1.2.10 and create a log4net extension project with additions and corrections from the svn code base that interest me? OR b. Create my own version of nhibernate using my own log4net assembly OR with. Make the log4net command a new version of log4net with the correct publicKeyToken

I would prefer c. and honestly, I can’t understand why they didn’t release a new version of the assembly at the age, there are a lot of corrections and new features in the svn source.

+4
source share
1 answer

What you want, exactly what signs, is intended to prevent.

Note that your c) option also requires a new Hibernate build.

I think b) is your best shot.

+2
source

All Articles