Hi All !

May be, there is some help.

I usually configure my apps using log4net with the assembly directive and I
am using this, for example:

[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension="l4n",
Watch=true)]

According to that, I have no <log4net> section in my apps config file and my
"app.l4n.config" contains usually only this configuration element:

<log4net debug="false">
        ...loggers .. appenders..
</log4net>


But, if I add the following to my apps config file [not that *.l4n.config!]:

<system.diagnostics>
        <performanceCounters fileMappingSize="2097152" />
</system.diagnostics>

log4net issues this error: "System.TypeInitializationException".
[see the complete exception at the end].

Could someone possibly have a look onto this?? Is my section in my
app.l4n.config wrong? Do I have the need for the <log4net> section -
possible empty - in my apps config file?

Thanks so far and
best regards,

mabra




Unhandled Exception: System.TypeInitializationException: The type
initializer for 'log4net.GlobalContext' threw an exception. --->
System.TypeInitializationExceptio
n: The type initializer for 'System.Net.ComNetOS' threw an exception. --->
System.Configuration.ConfigurationErrorsException: Unrecognized attribute
'fileMappingSiz
e'. Note that attribute names are case-sensitive.
(D:\BuB\Develop\Dev\Experimente\cs\Projects\MBG.PerformanceDataCollector\Exp
eriments\Step4.Combined\V0.1.8.x-N4\MB
G.CounterListReader4.exe.Config line 6)
   at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[]
keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord,
SectionRecord sect
ionRecord, Object parentResult)
   at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord
factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean
getLkg, Boolean g
etRuntimeObject, Object& result, Object& resultRuntimeObject)
   at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean
requestIsHere, Object& result, Object& resultRuntimeObject)
   at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean
requestIsHere, Object& result, Object& resultRuntimeObject)
   at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean
requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String
configKey)
   at
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal
.IInternalConfigSystem.GetSection(String sectionName)
   at System.Configuration.ConfigurationManager.GetSection(String
sectionName)
   at System.Configuration.PrivilegedConfigurationManager.GetSection(String
sectionName)
   at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
   at System.Diagnostics.DiagnosticsConfiguration.Initialize()
   at System.Diagnostics.DiagnosticsConfiguration.get_Sources()
   at System.Diagnostics.TraceSource.Initialize()
   at System.Net.Logging.InitializeLogging()
   at System.Net.Logging.get_On()
   at System.Net.ComNetOS.GetWindowsInstallType()
   at System.Net.ComNetOS..cctor()
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.InitializeSockets()
   at System.Net.Dns.GetHostName()
   at log4net.Util.SystemInfo.get_HostName()
   at log4net.GlobalContext..cctor()
   --- End of inner exception stack trace ---
   at log4net.GlobalContext.get_Properties()
   at MBG.Nix2wwg.CounterListReader..ctor() in
d:\BuB\Develop\Dev\Experimente\cs\Projects\MBG.PerformanceDataCollector\Expe
riments\Step4.Combined\V0.1.8.x-N4\MBG.Co
unterListReader4.cs:line 146
   at MBG.Nix2wwg.CounterListReader.Main() in
d:\BuB\Develop\Dev\Experimente\cs\Projects\MBG.PerformanceDataCollector\Expe
riments\Step4.Combined\V0.1.8.x-N4\MBG.Cou
nterListReader4.cs:line 111



Reply via email to