What type of application are you building? From the look of the call stack it looks like some kind of VS add-in. If so which version of VS? I can't reproduce this with a simple forms app so it may be some interaction with the hosting process.
Is it possible for you to post the source to a bare bones version of your app? Just something that it launched in the same way, has a form which is displayed, and calls XmlConfigurator.Configure from the OnLoad method. If I can reproduce the problem it is much easier to fix. Cheers, Nicko > -----Original Message----- > From: depsi programmer [mailto:[EMAIL PROTECTED] > Sent: 04 October 2005 05:40 > To: Log4NET User > Subject: TypeInitializationException was unhandled > > Hi > > I am getting following error in log4.net > > The exact error message and stack trace: > > System.TypeInitializationException was unhandled > > Message="The type initializer for > 'log4net.Core.LoggerManager' threw an exception." > > Source="log4net" > > TypeName="log4net.Core.LoggerManager" > > StackTrace: > > at > log4net.Core.LoggerManager.GetRepository(Assembly > repositoryAssembly) > > at log4net.LogManager.GetRepository(Assembly > repositoryAssembly) > > at log4net.Config.XmlConfigurator.Configure() > > at System.Windows.Forms.Form.OnLoad(EventArgs e) > > at System.Windows.Forms.Form.OnCreateControl() > > at > System.Windows.Forms.Control.CreateControl(Boolean > fIgnoreVisible) > > at System.Windows.Forms.Control.CreateControl() > > at > System.Windows.Forms.Control.WmShowWindow(Message& m) > > at System.Windows.Forms.Control.WndProc(Message& > m) > > at > System.Windows.Forms.ScrollableControl.WndProc(Message& > m) > > at > System.Windows.Forms.ContainerControl.WndProc(Message& > m) > > at > System.Windows.Forms.Form.WmShowWindow(Message& m) > > at System.Windows.Forms.Form.WndProc(Message& m) > > at > System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& > m) > > at > System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& > m) > > at > System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr > hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) > > at > System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef > hWnd, Int32 msg, Int32 wParam, Int32 lParam) > > at > System.Windows.Forms.Form.SetVisibleCore(Boolean > value) > > at > System.Windows.Forms.Control.set_Visible(Boolean > value) > > at > System.Windows.Forms.Application.ThreadContext.RunMessageLoopI > nner(Int32 > reason, ApplicationContext context) > > at > System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 > reason, ApplicationContext context) > > at System.Windows.Forms.Application.Run(Form > mainForm) > > at System.AppDomain.nExecuteAssembly(Assembly > assembly, String[] args) > > at System.AppDomain.ExecuteAssembly(String > assemblyFile, Evidence assemblySecurity, String[] > args) > > at > Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > > at > System.Threading.ThreadHelper.ThreadStart_Context(Object > state) > > at > System.Threading.ExecutionContext.Run(ExecutionContext > executionContext, ContextCallback callback, Object > state) > > at System.Threading.ThreadHelper.ThreadStart() > > When I checked the inner exception it was > > The inner exception is > The type initializer for 'log4net.Core.LoggerManager' > threw an exception. > Stack Trace is > at log4net.Core.LoggerManager.GetRepository(Assembly > repositoryAssembly) > at log4net.LogManager.GetRepository(Assembly > repositoryAssembly) > at log4net.Config.XmlConfigurator.Configure() > at xyz.FrmMain.Form1_Load(Object sender, EventArgs > e) in xyz.vb:line 147 > at System.Windows.Forms.Form.OnLoad(EventArgs e) > at System.Windows.Forms.Form.OnCreateControl() > at > System.Windows.Forms.Control.CreateControl(Boolean > fIgnoreVisible) > at System.Windows.Forms.Control.CreateControl() > at > System.Windows.Forms.Control.WmShowWindow(Message& m) > at System.Windows.Forms.Control.WndProc(Message& m) > at > System.Windows.Forms.ScrollableControl.WndProc(Message& > m) > at > System.Windows.Forms.ContainerControl.WndProc(Message& > m) > at System.Windows.Forms.Form.WmShowWindow(Message& > m) > at System.Windows.Forms.Form.WndProc(Message& m) > at > System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& > m) > at > System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& > m) > at > System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr > hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) > at > System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef > hWnd, Int32 msg, Int32 wParam, Int32 lParam) > at System.Windows.Forms.Form.SetVisibleCore(Boolean > value) > at System.Windows.Forms.Control.set_Visible(Boolean > value) > at > System.Windows.Forms.Application.ThreadContext.RunMessageLoopI > nner(Int32 > reason, ApplicationContext context) > at > System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 > reason, ApplicationContext context) > at System.Windows.Forms.Application.Run(Form > mainForm) > at System.AppDomain.nExecuteAssembly(Assembly > assembly, String[] args) > at System.AppDomain.ExecuteAssembly(String > assemblyFile, Evidence assemblySecurity, String[] > args) > at > Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at > System.Threading.ThreadHelper.ThreadStart_Context(Object > state) > at > System.Threading.ExecutionContext.Run(ExecutionContext > executionContext, ContextCallback callback, Object > state) > at System.Threading.ThreadHelper.ThreadStart() > > > > __________________________________ > Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com > >
