I also get this via AppDomain.CurrentDomain.FirstChangeException but my
application behave correctly, I do not get the exception in my actual
application and AFAIK it's a log4net internal exception.

On Tue, Oct 4, 2011 at 5:01 PM, Jorge Caballero <
[email protected]> wrote:

> Hi All,
>
> I'm having the System.NotSupportedException exception on a windows
> application. I've created a simple console application to try
> resolving the issue. I'm using NHiberntae and Log4Net. When running
> the console application, I receive the error:
>
> System.NotSupportedException occurred
>  Message=The invoked member is not supported in a dynamic assembly.
>  Source=mscorlib
>  StackTrace:
>       at
> System.Reflection.Emit.InternalAssemblyBuilder.get_Location()
>  InnerException:
>
> # The line of code where the exception is thrown:
> Configuration cfg = new Configuration();
>
> # The stack:
>        mscorlib.dll!
> System.Reflection.Emit.InternalAssemblyBuilder.Location.get() + 0x39
> bytes
>        log4net.dll!
> log4net.Util.SystemInfo.AssemblyLocationInfo(System.Reflection.Assembly
> myAssembly) + 0x74 bytes
>        log4net.dll!
>
> log4net.Core.DefaultRepositorySelector.GetInfoForAssembly(System.Reflection.Assembly
> assembly, ref string repositoryName, ref System.Type repositoryType) +
> 0x116 bytes
>        log4net.dll!
>
> log4net.Core.DefaultRepositorySelector.CreateRepository(System.Reflection.Assembly
> repositoryAssembly, System.Type repositoryType, string repositoryName,
> bool readAssemblyAttributes) + 0x166 bytes
>        log4net.dll!
>
> log4net.Core.DefaultRepositorySelector.CreateRepository(System.Reflection.Assembly
> repositoryAssembly, System.Type repositoryType) + 0x37 bytes
>        log4net.dll!
>
> log4net.Core.DefaultRepositorySelector.GetRepository(System.Reflection.Assembly
> repositoryAssembly) + 0x7b bytes
>        log4net.dll!
> log4net.Core.LoggerManager.GetLogger(System.Reflection.Assembly
> repositoryAssembly, string name) + 0xc0 bytes
>        log4net.dll!log4net.LogManager.GetLogger(System.Reflection.Assembly
> repositoryAssembly, string name) + 0x2c bytes
>        log4net.dll!log4net.LogManager.GetLogger(System.Type type) + 0x3f
> bytes
>        [Lightweight Function]
>        NHibernate.dll!NHibernate.Log4NetLoggerFactory.LoggerFor(System.Type
> type) Line 238 + 0x11 bytes     C#
>        NHibernate.dll!NHibernate.LoggerProvider.LoggerFor(System.Type type)
> Line 119 + 0x11 bytes   C#
>        NHibernate.dll!NHibernate.Cfg.Configuration.Configuration() Line 80
> + 0x23 bytes    C#
>        [Native to Managed Transition]
>        [Managed to Native Transition]
> >       LogginSample.exe!LogginSample.Program.Main(string[] args) Line 21 +
> 0x16 bytes  C#
>        [Native to Managed Transition]
>        [Managed to Native Transition]
>        mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile,
> System.Security.Policy.Evidence assemblySecurity, string[] args) +
> 0x6d bytes
>        Microsoft.VisualStudio.HostingProcess.Utilities.dll!
> Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() +
> 0x2a bytes
>        mscorlib.dll!
> System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x63
> bytes
>        mscorlib.dll!
> System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
> executionContext, System.Threading.ContextCallback callback, object
> state, bool ignoreSyncCtx) + 0xb0 bytes
>        mscorlib.dll!
> System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
> executionContext, System.Threading.ContextCallback callback, object
> state) + 0x2c bytes
>        mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44
> bytes
>
> Could somebody help to find out the root of this error?
>
> Thanks in advanced.




-- 
Ramon

Reply via email to