While upgrading a project (using NHibernate + Mono) to v4.1.1, my code was failing whenever NHibernate tried to bootstrap proxies for any class containing method with generic arguments.
The actual error/exception were like:
This looks to be related to this same envers issue: https://nhibernate.jira.com/browse/NHE-140
After debugging a few hours, I found the issue to be here: https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Proxy/DynamicProxy/DefaultMethodEmitter.cs#L85
Inside 'EmitMethodBody' method, there is this code:
It looks like the second call to PushTargetMethodInfo, should instead read like:
Somehow this typo did pass on MS.NET, but mono is a bit more strict and the generated code ends up referring to a non-yet-existing method.