有没有一种方法来反编译通过NHibernate的生成的动态代理类?方法来、反编译、动态、NHibernate

2023-09-03 05:17:01 作者:囍爷

我真的想知道什么是在动态代理类,NHibernate的生成回事。

I really like to know what's going on in the dynamic proxy classes that NHibernate generates.

我懂得了什么NHibernate的动态代理办上了一个台阶,但它绝对可以派上用场,能够在调试期间会进行反编译它们(使用反射或相似的东西)。

I'm quite aware of what NHibernate dynamic proxies do on a higher level but it could definitely come in handy to be able to decompile them (using Reflector or something alike) during debugging sessions.

那么,有没有办法通过反编译NHibernate的生成的动态代理类?

So, is there a way to decompile the dynamic proxy classes that are generated by NHibernate?

推荐答案

可以使用NHibernate 3.2.0来完成(旧版本不生成代理自理)。只需重新编译NHibernate的源与调试和DEBUG_PROXY_OUTPUT编译符号。 NHibernate的会接着写的模块(* .mod的)和组件(generatedAssembly.dll)文件时创建一个代理类型的当前目录。

It can be done using NHibernate 3.2.0 (older version don't generate the proxies themself). Just recompile the NHibernate source with the DEBUG and DEBUG_PROXY_OUTPUT compilation symbols. NHibernate will then write the module (*.mod) and assembly (generatedAssembly.dll) files to the current directory when a proxy type is created.