В гаке лежит log4net дллка.
gacutil -l
The Global Assembly Cache contains the following assemblies:
Log4Net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL
Number of items = 1
В гаке лежит плагин для IIS'а которому нужен log4net.
Конфигурируется, log4net вот так :
var log4NetSection =
"<log4net>" +
"<appender name=\"UdpAppender\" type=\"log4net.Appender.UdpAppender\">" +
"<remoteAddress value=\"127.0.0.1\" />" +
"<remotePort value=\"" + port.ToString(CultureInfo.InvariantCulture) + "\" />" +
"<layout type=\"log4net.Layout.PatternLayout, log4net\">" +
"<conversionPattern value=\"%date %-5level %logger %message%newline\" />" +
"</layout>" +
"</appender>" +
" <root>" +
" <level value=\"DEBUG\" />" +
" <appender-ref ref=\"UdpAppender\" />" +
" </root>" +
"</log4net>";
var xmlDoc = new XmlDocument();
xmlDoc.InnerXml = log4NetSection;
XmlConfigurator.Configure(xmlDoc.DocumentElement);
Пытаюсь подгрузить из гака log4net вот так(с рабочего стола этот способ работает):
Assembly.Load("Log4Net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL");
В результате ищет его непонятно где и не находит.
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\IUSR
LOG: DisplayName = log4net
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: log4net | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin
Calling assembly : log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/3e982689/8f741045/log4net.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/3e982689/8f741045/log4net/log4net.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/bin/log4net.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/bin/log4net/log4net.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/_app_bin/log4net.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/_app_bin/log4net/log4net.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/3e982689/8f741045/log4net.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/3e982689/8f741045/log4net/log4net.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/bin/log4net.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/bin/log4net/log4net.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/_app_bin/log4net.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/_app_bin/log4net/log4net.EXE.
log4net:ERROR Failed to create object to set param: layout
log4net:ERROR Failed to create object to set param: layout
почему он он не грузится и как его подгрузить?