Reflection question

J

Jim Frapper

Is it possible to get a list of the local variables and their
corresponding values? For example, take a look at the following IL:

..locals init ([0] int32 i,
[1] string x,
[2] class [mscorlib]System.Reflection.Assembly a,
[3] class [mscorlib]System.Reflection.Assembly assem,
[4] class [mscorlib]System.Type[] types2,
[5] class [mscorlib]System.Reflection.MemberInfo[]
myMemberInfo,
[6] class [mscorlib]System.Reflection.MemberInfo mi,
[7] class [mscorlib]System.Reflection.MemberInfo[]
CS$00000007$00000000,
[8] int32 CS$00000008$00000001)

This is just the IL representation of my local objects. I have look
through the Reflection namespace and couldn't find any method that
will give me the above list. The closest I have come is the
getMembers funtion off of the type class. However, no combination of
binding flags gives me the above list.

This seems very odd not to be able to retrieve this info, its right at
the front of the IL. I am using the 1.0 framework with the first
version of VS.NET.

JF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top