Thursday, March 22, 2007

Hi,
Dynamically rewrite Microsoft Intermediate Language code on the fly? How it sounds? Interesting isn't it? Yes! using the Profiling API of the CLR you can do that. Unlike approaches based on Reflection.Emit, this scheme works with the existing assemblies and doesn't require the creation of proxy or dynamic assemblies. The need for IL code rewriting emerges when you want to make your changes transparent to the client and preserve the identity of classes. This technique can be used for creation of interceptors, pre- and post-processing method calls, and code instrumentation and verification.

Please refer this nice article by Aleksandr Mikunov

http://msdn.microsoft.com/msdnmag/issues/03/09/NETProfilingAPI/default.aspx

Regards
Pankaj

0 comments:

Post a Comment