Josh
Josh

Reputation: 16567

System.ArgumentException : Duplicate dynamic module name within an assembly in Nhibernate 3.3.0.4000

I'm having an issue I cannot reproduce and I cannot track down. It happens for one client, in one area of the site, on one environment only.

System.ArgumentException : Duplicate dynamic module name within an assembly.

StackTrace

at System.Reflection.Emit.AssemblyBuilderData.CheckNameConflict(String strNewModuleName) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at 
System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at 
System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String name) at 
NHibernate.Proxy.DynamicProxy.DefaultProxyAssemblyBuilder.DefineDynamicModule(String moduleName) at NHibernate.Proxy.DynamicProxy.ProxyFactory.CreateUncachedProxyType(Type baseType, Type[] baseInterfaces) at 
NHibernate.Proxy.DynamicProxy.ProxyFactory.CreateProxyType(Type baseType, Type[] interfaces) at NHibernate.Proxy.DynamicProxy.ProxyFactory.CreateProxy(Type instanceType, IInterceptor interceptor, Type[] baseInterfaces) at 
NHibernate.Proxy.DefaultProxyFactory.GetProxy(Object id, ISessionImplementor session)

There are numerous posts saying that it's a problem with Castle.DynamicProxy but the version of nhibernate I am using does not need/use the castle library. I am using NuGet for my FluentNHibernate reference and everything is up to date.

I checked the bin on the server and there is no castle dll. The nhibernate dll is the correct version.

Upvotes: 1

Views: 1091

Answers (1)

Oskar Berggren
Oskar Berggren

Reputation: 5648

This is a race condition bug in NHibernate, see https://nhibernate.jira.com/browse/NH-3172.

It is fixed in 3.3.1GA which should be available for download within a few hours.

Upvotes: 2

Related Questions