Fixed
Details
Details
Assignee
Patrick Earl
Patrick EarlReporter
David Schmitt
David SchmittComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created July 21, 2011 at 9:37 AM
Updated July 30, 2011 at 2:11 PM
Resolved July 21, 2011 at 4:07 PM
Hi,
mono (2.10) has a non-standard debugging method "internal extern IntPtr obj_address ();" on all System.Objects. This trips up the DynProxyTypeValidator:
NHibernate.InvalidProxyTypeException: The following types may not be used as proxies:
[...]: method obj_address should be 'public/protected virtual' or 'protected internal virtual'
See also https://forum.hibernate.org/viewtopic.php?t=995115&sid=5cec5777f93ac61a388ef544277e4f74 for an old discussion of the problem.
There is an easy workaround by extending the DefaultDynamicProxyMethodCheckerExtensions.ShouldBeProxiable(this MethodInfo method) method by an additional "(!(method.DeclaringType == typeof(object) && "obj_address".Equals(method.Name)))" clause, thus avoiding the method when trying to proxy an object.
I've tested this with my application on MS.net and mono without problems.