InvalidProxyTypeException on mono 2.10 over object.obj_address

Description

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.

Environment

None

Attachments

1

Activity

Show:

Fabio Maulo 
July 30, 2011 at 2:11 PM

Closed after final release of NH3.2.0GA

David Schmitt 
July 21, 2011 at 9:41 AM

unified diff of the change

Fixed

Details

Assignee

Reporter

Components

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
Who's Looking?