When I try to use the Prosa TCPAppender (via "Prosa.LogAppender.dll"), I get the following error on startup:
Both the Log4Net.dll and the Proso.LogAppender.dll are in the same directory as the application. File, Console, and UDP logging work just fine. Any idea what this is trying to tell me, and more importantly, how to fix it? Thanks for the help! log4net:ERROR Could not create Appender [TcpAppender1] of type [prosa.LogAppender.TcpAppender, prosa.LogAppender]. Reported error follows. System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' or one of its dependencies. The located assembly's manifest d efinition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFrom PartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromParti alName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly, String typeName, Boolean throwOnError, Boolean ignoreCase) at log4net.Util.SystemInfo.GetTypeFromString(String typeName, Boolean throwOnError, Boolean ignoreCase) at log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement appenderElement) === Pre-bind state information === LOG: DisplayName = log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a (Fully-specified) LOG: Appbase = file:///D:/Dev/ExcelMedical/BedComm/Core/Software/BRTestApp1/bin/Debug/ LOG: Initial PrivatePath = NULL Calling assembly : Prosa.LogAppender, Version=11.2.502.1, Culture=neutral, PublicKeyToken=4f00b09a1fd60f6e. === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\Dev\ExcelMedical\BedComm\Core\Software\BRTestApp1\bin\Debug\BRTestApp1.vshost.exe.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a LOG: Attempting download of new URL file:///D:/Dev/ExcelMedical/BedComm/Core/Software/BRTestApp1/bin/Debug/log4net.DLL. WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. log4net:ERROR Appender named [TcpAppender1] not found. 00:08:32.243 [T: 10] XTOUT BRTestApp1.BRTestApp1 [ 113] - Test! |
Administrator
|
Hi Bill, this can be caused by a log4net.dll version mismatch. The prosa.LogAppender.dll is currently compiled against log4net 1.2.13. The error message suggests however, that your logging application is using log4net 1.2.11. Just download the latest version of log4net (http://logging.apache.org/log4net/download_log4net.cgi) and try it again. Best Regards Ulrich Von: Bill Rebey [via Log4View Support] [mailto:[hidden email]] When I try to use the Prosa TCPAppender (via "Prosa.LogAppender.dll"), I get the following error on startup: If you reply to this email, your message will be added to the discussion below: http://forum.log4view.com/Can-t-load-TcpAppender-manifest-defininition-does-not-match-tp71.html To start a new topic under Log4View Support, email [hidden email] smime.p7s (8K) Download Attachment |
In reply to this post by Bill Rebey
Thanks, Ulrich!
I had to get the new Log4Net, and upgrade to Studio 2013 (from 2010), and switch to .NET 4.5...but after all that...that fixed the first problem! I can now load the application without the "mistmatch" exception. However, I can't get Log4Net to show me any output from the TCP Appender. Iv'e tried setting up Log4View via both "New Configuration" and 'Connect to Network Stream'. Neither produces any errors, but neither produces results, either. I've selected host 'localhost', port 900, and "TCP Client" in the Network Receiver dialog box. The relevant sections of my Log4Net configuration are shown below. The UDP, File, and Console appenders work just fine and produce expected output in the Console and File. *** ODDLY, Log4View ONLY SHOWS UDP output. It seems unable to display anything for the File and/or TCP Appenders. Any ideas waht's wrong? <appender name="TcpAppender1" type="prosa.LogAppender.TcpAppender, prosa.LogAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date{HH:mm:ss.fff} [T:%3thread] %-9.9level %30.30logger [%4L] - %message%newline" /> </layout> </appender> <root> <level value="DEBUG"/> <appender-ref ref="RollingLogFileAppender"/> <appender-ref ref="ConsoleAppender"/> <appender-ref ref="UdpAppender"/> <appender-ref ref="TcpAppender1"/> </root> |
Administrator
|
This post was updated on .
Dear Bill,
it seems like your Log4Net TCP configuration is missing the port parameter. Also please use the XML layout: <appender name="TcpAppender1" type="prosa.LogAppender.TcpAppender, prosa.LogAppender"> <param name="LocalPort" value="900"/> <layout type="log4net.Layout.XmlLayout"/> </appender> Your file appender must be declared in the configuration, too. For example: <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender" > <file value="Messages.xlog"/> <appendToFile value="true"/> <rollingStyle value="Size"/> <maxSizeRollBackups value="199"/> <maximumFileSize value="100MB"/> <staticLogFileName value="true"/> <preserveLogFileNameExtension value="true"/> <layout type="log4net.Layout.XmlLayout"> <locationInfo value="false"/> </layout> </appender> You may find various configuration examples at Apache: http://logging.apache.org/log4net/release/config-examples.html Yours sincerely Philipp Lauchner PROSA GmbH Development & Support |
Free forum by Nabble | Edit this page |