RE: Help with Log4Net
2005-06-01 00:39:59 GMT
--b
Thanks – but I am really struggling with this. I tried the binding redirect and I am guessing that I am failing because the Maverick.net version of Log4Net does not have a public key the redirect does not work – or I need to supply some other parameter/file. If you can review the following and let me know how to straighten out:
From Maverick:
|
// Assembly Reference log4net |
|
Version: |
1.2.0.33710 |
|
Name: |
log4net, Version=1.2.0.33710, Culture=neutral, PublicKeyToken=null |
From nHibernate:
|
// Assembly Reference log4net |
|
Version: |
1.2.0.30714 |
|
Name: |
log4net, Version=1.2.0.30714, Culture=neutral, PublicKeyToken=b32731d11ce58905 |
Added to web.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net"
publicKeyToken="b32731d11ce58905"
culture="neutral"/>
<bindingRedirect oldVersion="1.2.0.30714"
newVersion="1.2.0.33710"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Result when nHibernate is invoked with nHibernate code:
=== Pre-bind state information ===LOG: DisplayName = log4net, Version=1.2.0.30714, Culture=neutral, PublicKeyToken=b32731d11ce58905 (Fully-specified)LOG: Appbase = file:///C:/Inetpub/wwwroot/holmansiteLOG: Initial PrivatePath = binCalling assembly : (Unknown).===
LOG: Redirect found in application configuration file: 1.2.0.30714 redirected to 1.2.0.33710.LOG: Publisher policy file is not found.LOG: No redirect found in host configuration file (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.LOG: Post-policy reference: log4net, Version=1.2.0.33710, Culture=neutral, PublicKeyToken=b32731d11ce58905LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/holmansite/5bf290d5/6092c187/log4net.DLL.LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/holmansite/5bf290d5/6092c187/log4net/log4net.DLL.LOG: Attempting download of new URL file:///C:/Inetpub/wwwroot/holmansite/bin/log4net.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
From:
mavnet-user-admin <at> lists.sourceforge.net [mailto:mavnet-user-admin <at> lists.sourceforge.net]
On Behalf Of Ben Lowery
Sent: Sunday, May 29, 2005 7:58 PM
To: mavnet-user <at> lists.sourceforge.net
Subject: RE: [Mavnet-user] Help
with Log4Net
Quite possibly.. in the application that is using both NHibernate and log4net, you'll need to add some bindingRedirects to your app .config file (web.config if you're inside ASP.NET) telling the framework to load your preferred rev of log4net no matter what. You can find information on binding redirects on MSDN. [1]
--b
From: mavnet-user-admin <at> lists.sourceforge.net
[mailto:mavnet-user-admin <at> lists.sourceforge.net] On Behalf Of Cal
Sent: Sunday, May 29, 2005 7:47 PM
To: mavnet-user <at> lists.sourceforge.net
Subject: [Mavnet-user] Help with
Log4Net
I am hoping some of you had this issue or can recommend a quick solution. I have Maverick.net working just fine with log4net – including my own application. But when I add NHibernate I get an error. NHibernate is using a different version of log4net than Maverick.net. So is there a simple method in the web.config to point various .dll files to the same version of log4net? Can I override the version Maverick.net or NHibernate is using? How do you move to the next version of log4net?
RSS Feed