Are you building the Log4Net binaries under .Net 4.0 prior to using them in your project?
From: Marc Gerritsen [mailto:marc.gerrit...@topicus.nl] Sent: 30 August 2010 14:25 To: log4net-user@logging.apache.org Subject: Problem in mixed .net 4.0 and 2.0 project Hello, We are building an application that makes use of log4net It also uses Spring.Net and NHibernate. When we upgraded our solution from VS 2008 to VS 2010 we got a problem. We changed the framework of all the projects to the full .net 4.0 framework. But we use some components we created our self and use them in many more projects. These projects are in framework 3.5 and can't be upgraded just yet. The problem is that when there is an exception triggered from a 3.5 component and catch it in a 4.0 project to log we get the following exception: <log4net.Error>Exception rendering object type [Force.Workflow.Core.Exceptions.WorkflowIllegalStatusChange]<stackTrace>Syst em.BadImageFormatException: The parameters and the signature of the method don't match. at System.Reflection.RuntimeParameterInfo.GetParameters(IRuntimeMethodInfo methodHandle, MemberInfo member, Signature sig, ParameterInfo& returnParameter, Boolean fetchReturnParameter) at System.Reflection.RuntimeMethodInfo.GetParameters() at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat) at System.Exception.GetStackTrace(Boolean needFileInfo) at System.Exception.ToString(Boolean needFileLineInfo) at log4net.ObjectRenderer.DefaultRenderer.RenderObject(RendererMap rendererMap, Object obj, TextWriter writer) at log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer)</stackTrace></log4net.Error> Does anyone have a clue how this is possible? An how we could fix it? Cheers, Marc Gerritsen