Skip to content

TypeLoadException when generating proxies for custom collection types #1881

@PleasantD

Description

@PleasantD

Ran into this when trying to get our Envers integration updated.

System.TypeLoadException : Declaration referenced in a method implementation cannot be a final method.  Type: 'PersistentObservableBag`1Proxy'.  Assembly: 'PersistentObservableBag`1ProxyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)
   at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
   at System.Reflection.Emit.TypeBuilder.CreateTypeInfo()
   at NHibernate.Proxy.DynamicProxy.ProxyFactory.CreateUncachedProxyType(Type baseType, IReadOnlyCollection`1 baseInterfaces)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at NHibernate.Proxy.DynamicProxy.ProxyFactory.CreateProxy(Type instanceType, IInterceptor interceptor, Type[] baseInterfaces)
   at NHibernate.Envers.Entities.Mapper.Relation.AbstractCollectionMapper.MapToEntityFromMap(AuditConfiguration verCfg, Object obj, IDictionary data, Object primaryKey, IAuditReaderImplementor versionsReader, Int64 revision)
   at NHibernate.Envers.Entities.Mapper.MultiPropertyMapper.MapToEntityFromMap(AuditConfiguration verCfg, Object obj, IDictionary data, Object primaryKey, IAuditReaderImplementor versionsReader, Int64 revision)
   at NHibernate.Envers.Entities.EntityInstantiator.CreateInstanceFromVersionsEntity(String entityName, IDictionary versionsEntity, Int64 revision)
   at NHibernate.Envers.Query.Impl.AllEntitiesAtRevisionQuery`1.<Results>b__2_0(IDictionary versionsEntity)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at NHibernate.Envers.Query.Impl.AbstractRevisionsQuery`1.Single()
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions