Hi I just wanted to get the sequence points for the method Invoke in class SyncInvoker an internal class found in
System
Dispatcher namespace which is under System.ServiceModel dll.
AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.ServiceModel.dll");
List<SequencePoint> seqPointsIns = new List<SequencePoint>();
//Gets all types of the MainModule of the assembly
foreach(TypeDefinition type in assembly.MainModule.Types)
{
if (type.Name == "SyncMethodInvoker")
{
foreach (MethodDefinition method in type.Methods)
{
if (method.Name == "Invoke")
{
var il = method.Body.GetILProcessor();
foreach (var item in il.Body.Instructions)
{
if (item.SequencePoint != null)
{
seqPointsIns.Add(item.SequencePoint);
}
}
}
}
}
}
As you can see I try get sequence points. Here the il.Body.Instructions is 0. What is wrong and how can it be rectified.?