MrAdvice: Debugging Async methods not working
I install MrAdvice in my project and I have this code which I have no problem in debugging :
class Program
{
static void Main()
{
Async().GetAwaiter().GetResult();
Non_Async();
}
static async Task Async()
{
var foo = "bar";
// can see foo in debug
}
static void Non_Async()
{
var foo = "bar";
// can see foo in debug
}
}
when I add an Advice class to my code, I can no longer see local variables in async methods in debug mode.
class Program
{
static void Main()
{
Async().GetAwaiter().GetResult();
Non_Async();
}
static async Task Async()
{
var foo = "bar";
// can NOT see foo in debug
}
static void Non_Async()
{
var foo = "bar";
// can see foo in debug
}
}
class AdviceA : Attribute, IMethodAdvice
{
public void Advise(MethodAdviceContext context)
{
Console.WriteLine("Entry From Advice A");
context.Proceed();
Console.WriteLine("Exit From Advice A");
}
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (7 by maintainers)
@picrap thanks, really appreciate it.
The async debug was solved in dnlib, so MrAdvice 2.5.3 uses it and solves the problem too.
Merged, building. The new version should be available on NuGet soon.