We've got a system set up where a Windows service kicks off a number of sort of "sub-services", each in their own AppDomains. Each sub-service is responsible for initializing the log4net system within it's domain. Everything works fine on developer machines (running Windows XP), but when we try to deploy it to a production machine (running Server 2K3) we get a TypeInitializationException (stack trace below). We're using log4net 1.2.9 beta.
I'm trying to get some log4net debug logs, but the machine that's producing the errors isn't directly under my control, so it's tricky. Has anyone seen this sort of behaviour before? The exception was: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for "D2L.Mail.MailService" threw an exception. ---> System.TypeInitializationException: The type initializer for "log4net.Core.LoggerManager" threw an exception. ---> System.TypeInitializationException: The type initializer for "log4net.Util.LogLog" threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Configuration.ConfigurationSettings.GetConfig(String sectionName) at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable() at System.Diagnostics.DiagnosticsConfiguration.Initialize() at System.Diagnostics.DiagnosticsConfiguration.get_IndentSize() at System.Diagnostics.TraceInternal.InitializeSettings() at System.Diagnostics.TraceInternal.get_Listeners() at System.Diagnostics.TraceInternal.WriteLine(String message) at System.Diagnostics.Trace.WriteLine(String message) at log4net.Util.LogLog.Error(String message, Exception exception) at log4net.Util.LogLog..cctor() --- End of inner exception stack trace --- at log4net.Util.LogLog.Debug(String message) at log4net.Core.LoggerManager..cctor() --- End of inner exception stack trace --- at log4net.Core.LoggerManager.GetLogger(Assembly repositoryAssembly, String name) at log4net.LogManager.GetLogger(Type type) at D2L.Mail.MailService..cctor() --- End of inner exception stack trace --- --- End of inner exception stack trace --- Server stack trace: at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark) at System.Activator.CreateInstance(String assemblyName, String typeName) at System.AppDomain.CreateInstance(String assemblyName, String typeName) at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName) at D2L.Management.D2LService..ctor(ID2LInstance instance, ServiceInfo info)
