Re: Loading problem with Custom Appender and GAC
"Gert Driesen" <[email protected]> Wed, 4 Feb 2004 15:06:50 +0100
| Newsgroups | gmane.comp.windows.dotnet.log4net.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. ------=_NextPart_000_01CF_01C3EB30.83F22D30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Marc, You need to specifiy the fully qualified assembly name in the log4net con= figuration section for assemblies that are located in the GAC. so you should have something like this : com.agfa.med.syslog.Log4jSyslogAppender, syslogappender, Version=3D<major= =2Eminor.build.revision>, Culture=3Dneutral, PublicKeyToken=3D<your publi= c key token> Hope this helps, Gert PS. goed om nog ne belg te zien hier :-) ----- Original Message -----=20 From: Marc Borgers=20 To: [email protected]=20 Sent: Tuesday, February 03, 2004 2:48 PM Subject: [Log4net-users] Loading problem with Custom Appender and GAC Hi,=20 I have a custom appender for log4net. It works fine when all Assemblies= are located in the=20 folder of the application. When log4net and my custom appender is in th= e GAC I get the following error when testing my application:=20 log4net:ERROR DOMConfigurator: Could not create Appender [SyslogAppende= r] of type [com.agfa.med.syslog.Log4jSyslogAppend=20 er,syslogappender]. Reported error follows.=20 System.IO.FileNotFoundException: File or assembly name syslogappender, = or one of its dependencies, was not found.=20 File name: "syslogappender"=20 at System.Type.GetType(String typeName, Boolean throwOnError, Boolea= n ignoreCase)=20 at log4net.helpers.SystemInfo.GetTypeFromString(Assembly relativeAss= embly, String typeName, Boolean throwOnError, Boo=20 lean ignoreCase)=20 at log4net.Repository.Hierarchy.DOMHierarchyConfigurator.ParseAppend= er(XmlElement appenderElement)=20 =3D=3D=3D Pre-bind state information =3D=3D=3D=20 LOG: DisplayName =3D syslogappender=20 (Partial)=20 LOG: Appbase =3D Q:\tspsw\proxySSL\audit\test\src\C++\AuditEventHandler= COM\Debug\=20 LOG: Initial PrivatePath =3D NULL=20 Calling assembly : log4net, Version=3D1.2.0.30714, Culture=3Dneutral, P= ublicKeyToken=3Db32731d11ce58905.=20 =3D=3D=3D=20 LOG: Policy not being applied to reference at this time (private, custo= m, partial, or location-based assembly bind).=20 LOG: Post-policy reference: syslogappender=20 LOG: Attempting download of new URL file:///Q:/tspsw/proxySSL/audit/tes= t/src/C++/AuditEventHandlerCOM/Debug/syslogappend=20 er.DLL.=20 LOG: Attempting download of new URL file:///Q:/tspsw/proxySSL/audit/tes= t/src/C++/AuditEventHandlerCOM/Debug/syslogappend=20 er/syslogappender.DLL.=20 LOG: Attempting download of new URL file:///Q:/tspsw/proxySSL/audit/tes= t/src/C++/AuditEventHandlerCOM/Debug/syslogappend=20 er.EXE.=20 LOG: Attempting download of new URL file:///Q:/tspsw/proxySSL/audit/tes= t/src/C++/AuditEventHandlerCOM/Debug/syslogappend=20 er/syslogappender.EXE.=20 log4net:ERROR DOMConfigurator: Appender named [SyslogAppender] not foun= d.=20 Classical (non-managed) COM application. What can I do to make log4net = find my custom appender ???=20 Marc Borgers ------------------------------------------------------- Th= e SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Ope= n Tools Development and Integration See the breadth of Eclipse activity. = February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _____________= __________________________________ Log4net-users mailing list Log4net-use= [email protected] https://lists.sourceforge.net/lists/listinfo/log= 4net-users=20 ------=_NextPart_000_01CF_01C3EB30.83F22D30 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-= 1"> <META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Marc,</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>You need to specifiy the fully qualified= assembly=20 name in the log4net configuration section for assemblies that are located= in the=20 GAC.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>so you should have something like this=20 :</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>com.agfa.med.syslog.Log4jSyslogAppend</F= ONT><FONT=20 face=3Dsans-serif size=3D2>er, syslogappender,=20 Version=3D<major.minor.build.revision>, Culture=3Dneutral,=20 PublicKeyToken=3D<your public key token></FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Hope this helps,</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Gert</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>PS. goed om nog ne belg te zien hier=20 :-)</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV>----- Original Message ----- </DIV> <BLOCKQUOTE=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-= LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>F= rom:</B>=20 <A [email protected] href=3D"mailto:[email protected]">= Marc=20 Borgers</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20 [email protected]=20 href=3D"mailto:[email protected]">log4net-users@lists= =2Esourceforge.net</A>=20 </DIV> <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, February 03, 2004= 2:48=20 PM</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Log4net-users] Loading= problem=20 with Custom Appender and GAC</DIV> <DIV><BR></DIV><BR><FONT face=3Dsans-serif size=3D2>Hi,</FONT> <BR><BR>= <FONT=20 face=3Dsans-serif size=3D2>I have a custom appender for log4net. It wor= ks fine=20 when all Assemblies are located in the </FONT><BR><FONT face=3Dsans-ser= if=20 size=3D2>folder of the application. When log4net and my custom appender= is in=20 the GAC I get the following error when testing my application:</FONT>=20 <BR><BR><FONT face=3Dsans-serif size=3D2>log4net:ERROR DOMConfigurator:= Could not=20 create Appender [SyslogAppender] of type=20 [com.agfa.med.syslog.Log4jSyslogAppend</FONT> <BR><FONT face=3Dsans-ser= if=20 size=3D2>er,syslogappender]. Reported error follows.</FONT> <BR><FONT=20 face=3Dsans-serif size=3D2>System.IO.FileNotFoundException: File or ass= embly name=20 syslogappender, or one of its dependencies, was not found.</FONT> <BR><= FONT=20 face=3Dsans-serif size=3D2>File name: "syslogappender"</FONT> <BR><FONT= =20 face=3Dsans-serif size=3D2> at System.Type.GetType(String t= ypeName,=20 Boolean throwOnError, Boolean ignoreCase)</FONT> <BR><FONT face=3Dsans-= serif=20 size=3D2> at log4net.helpers.SystemInfo.GetTypeFromString(A= ssembly=20 relativeAssembly, String typeName, Boolean throwOnError, Boo</FONT> <BR= ><FONT=20 face=3Dsans-serif size=3D2>lean ignoreCase)</FONT> <BR><FONT face=3Dsan= s-serif=20 size=3D2> at=20 log4net.Repository.Hierarchy.DOMHierarchyConfigurator.ParseAppender(Xml= Element=20 appenderElement)</FONT> <BR><BR><FONT face=3Dsans-serif size=3D2>=3D=3D= =3D Pre-bind=20 state information =3D=3D=3D</FONT> <BR><FONT face=3Dsans-serif size=3D2= >LOG: DisplayName=20 =3D syslogappender</FONT> <BR><FONT face=3Dsans-serif=20 size=3D2> (Partial)</FONT> <BR><FONT face=3Dsans-serif size=3D2>LO= G: Appbase =3D=20 Q:\tspsw\proxySSL\audit\test\src\C++\AuditEventHandlerCOM\Debug\</FONT>= =20 <BR><FONT face=3Dsans-serif size=3D2>LOG: Initial PrivatePath =3D NULL<= /FONT>=20 <BR><FONT face=3Dsans-serif size=3D2>Calling assembly : log4net,=20 Version=3D1.2.0.30714, Culture=3Dneutral, PublicKeyToken=3Db32731d11ce5= 8905.</FONT>=20 <BR><FONT face=3Dsans-serif size=3D2>=3D=3D=3D</FONT> <BR><BR><FONT fac= e=3Dsans-serif=20 size=3D2>LOG: Policy not being applied to reference at this time (priva= te,=20 custom, partial, or location-based assembly bind).</FONT> <BR><FONT=20 face=3Dsans-serif size=3D2>LOG: Post-policy reference: syslogappender</= FONT>=20 <BR><FONT face=3Dsans-serif size=3D2>LOG: Attempting download of new UR= L=20 file:///Q:/tspsw/proxySSL/audit/test/src/C++/AuditEventHandlerCOM/Debug= /syslogappend</FONT>=20 <BR><FONT face=3Dsans-serif size=3D2>er.DLL.</FONT> <BR><FONT face=3Dsa= ns-serif=20 size=3D2>LOG: Attempting download of new URL=20 file:///Q:/tspsw/proxySSL/audit/test/src/C++/AuditEventHandlerCOM/Debug= /syslogappend</FONT>=20 <BR><FONT face=3Dsans-serif size=3D2>er/syslogappender.DLL.</FONT> <BR>= <FONT=20 face=3Dsans-serif size=3D2>LOG: Attempting download of new URL=20 file:///Q:/tspsw/proxySSL/audit/test/src/C++/AuditEventHandlerCOM/Debug= /syslogappend</FONT>=20 <BR><FONT face=3Dsans-serif size=3D2>er.EXE.</FONT> <BR><FONT face=3Dsa= ns-serif=20 size=3D2>LOG: Attempting download of new URL=20 file:///Q:/tspsw/proxySSL/audit/test/src/C++/AuditEventHandlerCOM/Debug= /syslogappend</FONT>=20 <BR><FONT face=3Dsans-serif size=3D2>er/syslogappender.EXE.</FONT> <BR>= <BR><FONT=20 face=3Dsans-serif size=3D2>log4net:ERROR DOMConfigurator: Appender name= d=20 [SyslogAppender] not found.</FONT> <BR><BR><BR><FONT face=3Dsans-serif=20 size=3D2>Classical (non-managed) COM application. What can I do to make= log4net=20 find my custom appender ???</FONT> <BR><BR><BR><FONT face=3Dsans-serif=20 size=3D2>Marc Borgers</FONT>=20 ------------------------------------------------------- The SF.Net emai= l is=20 sponsored by EclipseCon 2004 Premiere Conference on Open Tools Developm= ent and=20 Integration See the breadth of Eclipse activity. February 3-5 in Anahei= m, CA.=20 http://www.eclipsecon.org/osdn ________________________________________= _______=20 Log4net-users mailing list [email protected]=20 https://lists.sourceforge.net/lists/listinfo/log4net-users=20 </BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_01CF_01C3EB30.83F22D30-- ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn