Since this morning, our CI build failed due to surprising "System.ArgumentException : Duplicate type name within an assembly." exceptions during our tests execution.
(note: our tests project built in .NET (4.6) using references to NUnit (3.9.0.0) and NSubstitute (3.1.0.0).
So far we have step into mscorlib (ModuleBuilder type) and found out that Castle.DynamicProxy was dynamically generating an assembly to host its stubs/fakes/ named: DynamicProxyGenAssembly2. And it seems that we had more than one reference for type named "Castle.Proxies.IEnumerator`1Proxy_13".
We don't really understand what's going on here. We appreciate any suggestion on how to understand and find out a solution.
Stack trace example: -----------------
at System.Reflection.Emit.ModuleBuilder.CheckTypeNameConflict(String strTypeName, Type enclosingType)
at System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
at System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, ModuleBuilder module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
at System.Reflection.Emit.ModuleBuilder.DefineTypeNoLock(String name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packingSize, Int32 typesize)
at System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr)
at Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope modulescope, String name, Type baseType, IEnumerable1 interfaces, TypeAttributes flags, Boolean forceUnsigned)
at Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope modulescope, String name, Type baseType, IEnumerable
1 interfaces)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.BuildClassEmitter(String typeName, Type parentType, IEnumerable1 interfaces)
at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.Init(String typeName, ClassEmitter& emitter, Type proxyTargetType, FieldReference& interceptorsField, IEnumerable
1 interfaces)
at Castle.DynamicProxy.Generators.InterfaceProxyWithoutTargetGenerator.GenerateType(String typeName, Type proxyTargetType, Type[] interfaces, INamingScope namingScope)
at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.<>c__DisplayClass6_0.b__0(String n, INamingScope s)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func3 factory)
at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)
at NSubstitute.Proxies.CastleDynamicProxy.CastleDynamicProxyFactory.GenerateProxy(ICallRouter callRouter, Type typeToProxy, Type[] additionalInterfaces, Object[] constructorArguments)
at NSubstitute.Core.SubstituteFactory.Create(Type[] typesToProxy, Object[] constructorArguments, SubstituteConfig config)
at NSubstitute.Routing.Handlers.ReturnAutoValue.<>c__DisplayClass6_0.<ReturnValueUsingProvider>b__0(IAutoValueProvider provider)
at NSubstitute.Routing.Handlers.ReturnAutoValue.Handle(ICall call)
at System.Linq.Enumerable.WhereSelectArrayIterator
2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func
2 predicate)
at NSubstitute.Routing.Route.Handle(ICall call)
at NSubstitute.Proxies.CastleDynamicProxy.CastleForwardingInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.IEnumerable1Proxy_16.GetEnumerator()
at System.Linq.Buffer
1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
at Caraibes.Infrastructure.AggregateCreationAuditTrail.BuildCacheFromEventStore(AggregateType aggregateType) in E:\Builds\TheFuture01_work\366\s\Caraibes\Caraibes.Infrastructure\AggregateCreationAuditTrail.cs:line 45
at Caraibes.Infrastructure.AggregateCreationAuditTrail.HasAlreadyBeenCreated(AggregateType aggregateType, Int32 lightTradeId) in E:\Builds\TheFuture01_work\366\s\Caraibes\Caraibes.Infrastructure\AggregateCreationAuditTrail.cs:line 31
at Caraibes.Tests.Domain.EventSourcing.AggregateCreationAuditTrailShould.Only_call_EventStore_when_previous_request_did_not_contained_the_requested_identifier(AggregateType aggregateType) in E:\Builds\TheFuture01_work\366\s\Caraibes\Caraibes.Tests\Domain\EventSourcing\AggregateCreationAuditTrailShould.cs:line 74
Attachments (0)