Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » DynamicMethod   (RSS)
The type " System.Array " provides us a set of API for the late-bound array operations, including array creation ( Array.CreateInstance ), read/write access to array element ( Array.SetValue / Array.GetValue ). They are convenient to use. Let me start Read More...
I was glad to hear many positive feedbacks about the DebuggerVisualizer for DynamicMethod ; on the sad side, it shows our lack of good LCG debugging support (on which, Mike Stall is seeking your opinion ). Recently along with the ILReader update, I made Read More...
I do not know why anyone ever need this :) but few readers did ask me similar questions before. Solving this problem also demonstrates one more ILReader usage. To build a DynamicMethod, we can choose either DynamicILGenerator or DynamicILInfo . My first Read More...
Compared to what I posted previously here (or what was used in the DynamicMethod visualizer ), this new version introduced the Visitor pattern . A do-nothing visitor ILInstructionVisitor is included; the users can focus on their domain-specific logic Read More...
Current dynamic method implementation does not have built-in support to pre-check whether the dynamic method code is verifiable. With bad IL sequence, very often you will get "System. InvalidProgramException : Common Language Runtime detected an invalid Read More...
Vararg (variable arguments) methods accept argument lists of unknown length and type. CLR supports this by the IL instruction (arglist) and other BCL types, such as System.ArgIterator . C# compiler has undocumented keyword "__arglist" to support defining Read More...
The following "Hello World" program shows how to use APIs in the class DynamicILInfo . MSDN documentation will have more details on this class in the next release. using System; using System.Reflection; using System.Reflection.Emit; class Demo Read More...
Q : Assume we have 2000 unknown types; (however) we know each type has a constructor with integer as its' only parameter type. How to create objects 10000 times for each type (and make such late-new fast)? Activator.CreateInstance comes to my fingers Read More...
Have you ever tried DynamicMethod, one of the coolest features in the .NET 2.0? Hope you have; otherwise, you can try it now with the examples 1 , 2 . Like emitting IL to MethodBuilder, we first get ILGenerator from a DynamicMethod, and make a series Read More...
 
Page view tracker