Open jowliwon opened 1 year ago
Does it compile if you provide empty overrides for OnEntry and OnExit methods?
Im afraid not. As soon as OnException is in the code it stops compiling, with or without OnEntry and OnExit.
Can you try to return a Task or an int from the GetAsync() method? Maybe there are problems with fire and forget async method weaving
That worked!
private async Task GetAsync()
{
await WaitForResponse();
}
private async Task<bool> WaitForResponse()
{
await Task.Delay(1);
return true;
}
Great. Then this should also be reproducible if the attribute is just decorating the GetAsync() method if it returns void?
Yes, by having this on method level, its the same behavior. With and with out returning Task.
So then the bug is handling of void async methods. Wondering why this was not detected earlier.
So all in all you have a workaround and we can then create a test case for the issue
any workaround for this issue?
any workaround for this issue?
Sort of. Have to return a task, just read above.
So, the thing is I have this injection script I run on all my source files so they can all be monitored and observed for issues. It works well, instead of just do all of this manually.
I have these put on class level, not on individual methods like the example bellow.
How ever as Im only interested in capturing Exceptions at this stage, I have the ExceptionLogger it self look like this
This how ever will cause the weaver to drop error message on by that not compile.
This only happens when dealing with OnException on class level, OnEntry and OnExit passes just fine. Is there anything that can be done to deal with an issue like this?