Modify IL code on the fly
I want to modify .Net IL code of an existing class on the fly. Is that possible somehow? I found some references to the .Net Profiling API, but according to the documentation it does not support self modifying applications. The main purpose would be to replace getters and setters of some pro开发者_Python百科perties. Any hint would be very appreciated.
cheers, Achim
I'd suggest you check out Mono Cecil. Don't think you can't use Mono binaries in your windows .NET application.
Cecil is like reflection on steroids. You can not only reflect over an assembly, but alter its IL and save the result.
Here's a decent webcast about doing this.
精彩评论