I'm trying to migrate from 1.0.3 to 1.2.0. It seems that any attempt to instantiate a proxy now fails with the exception shown below. None of my code has changed, and it worked fine with 1.0.3.
Any ideas what has changed between 1.0.3 and 1.2.0 that would cause dynamicproxy to suddenly stop working?
Mapping documents:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="ClearCanvas.Enterprise.Authentication" namespace="ClearCanvas.Enterprise.Authentication">
<class name="User" table="User_">
<id name="OID" column="OID_" type="Guid">
<generator class="guid.comb"/>
</id>
<version name="Version" column="Version_"/>
<property name="UserName" column="UserName_" type="String" length="30" not-null="true" unique="true"/>
<set name="AuthorityGroups" table="AuthorityGroupUser_" lazy="true" cascade="all" access="nosetter.camelcase-underscore">
<key column="UserOID_"/>
<many-to-many column="AuthorityGroupOID_" class="AuthorityGroup" fetch="join"/>
</set>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
2007-10-15 13:30:34,406 [16] ERROR - Creating a proxy instance failed
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at CProxyTypeClearCanvas_Enterprise_AuthenticationUserAuthentication_NHibernate_ProxyINHibernateProxy1..ctor(IInterceptor )
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyInstance(Type type, IInterceptor interceptor, Object[] argumentsForConstructor)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type baseClass, Type[] interfaces, IInterceptor interceptor, Boolean checkAbstract, Object[] argumentsForConstructor)
at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
[/code]