【发布时间】:2018-04-25 08:33:08
【问题描述】:
我正在尝试查看 IAsyncStateMachine 在运行时发生了什么,我迫切需要查看它有哪些变量以及它调用了什么。我知道您可以使用 ILSpy 查看代码……但我需要调试它。
有什么方法吗? 我需要看看 IAsyncStateMachine MoveNext 方法内部发生了什么!
public sealed partial class MethodBuilder<T> : Errand.MethodBuilder {
public static new MethodBuilder<T> Create() => new MethodBuilder<T>();
public new void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine {
this.myStateMachine = stateMachine;
this.Task = new Task<T>(this);
stateMachine.MoveNext(); //i have to see the properties of stateMachine and inside this method !!!!!
}
public new void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine machine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine {
}
public void SetResult(T result) {
this.Task.isCompleted = true;
this.Task.result = result;
}
public new void SetStateMachine(IAsyncStateMachine stateMachine) => base.SetStateMachine(stateMachine);
public new void SetException(Exception ex) => base.SetException(ex);
}
【问题讨论】:
-
调试反编译代码时遇到问题的原因并不明显。除了我能想到的一个原因,使用工具 > 选项 > 调试 > 常规,取消勾选“只是我的代码”。
-
未勾选,但我无法进入 stateMachine.MoveNext() 方法。
标签: c# async-await decompiler