MethodBoundaryAspect.Fody icon indicating copy to clipboard operation
MethodBoundaryAspect.Fody copied to clipboard

Some enhancement ideas

Open jmartschinke opened this issue 4 years ago • 1 comments

It seems to me that many of the currently active issues arise because of the cloning of the original method. There is also still some missing debug information in certain circumstances, which I will report later. I tried to change it locally so that instead of weaving like this:

OnEntry();
try
{
   $_executor_Foo();
}
catch (Exception ex)
{
   OnException();
}
OnExit();

this would be woven:

OnEntry();
try
{
   // content of foo directly here instead of a call
}
catch (Exception ex)
{
   OnException();
}
OnExit();

I could only partially get that to work. The OnEntry() and the content of the Method get called, but OnExit() is not and i cannot get the decompiled sources.

Perhaps we could work together to look into this solution?

jmartschinke avatar Mar 01 '21 12:03 jmartschinke

The original design choice was to move the original method into another method and just call it. As we are no MSIL expert we didn't want to complicate the weaving process. But you are right, this messes up the debug informations.

If you need help can you specify what exact problem you encounter?

Ralf1108 avatar Mar 01 '21 13:03 Ralf1108