Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Aspect weaves it's own OnEntry method, ends up with a StackOverflowException #70

Open
haefele opened this issue Dec 30, 2019 · 4 comments

Comments

@haefele
Copy link

haefele commented Dec 30, 2019

Hello, I have an simple OnMethodBoundaryAspect that is supposed to do some logging for me.
I apply it to the assembly, so it get's added to every class and method in the assembly.
But my aspect is in that assembly too. So it will be added to it's own OnEntry method, which will lead to a StackOverflowException.

public class MyAspect : OnMethodBoundaryAspect
{
    public override void OnEntry(MethodExecutionArgs args)
    {
        Console.WriteLine("OnEntry");
    }
}

In AssemblyInfo.cs

[assembly: MyAspect]

image

@ha07z7xe
Copy link

ha07z7xe commented Jan 3, 2020

I have the same issue. I've moved my OnMethodBoundaryAspect to a separate assembly to solve it.

@DamirAinullin
Copy link

I also have such issue. Can you fix it please?

@Ralf1108
Copy link
Collaborator

As a workaround you can apply the DisableWeavingAttribute to your aspect class/method

I try to implement as default behavior that aspects wont weave themselves

Ralf1108 pushed a commit that referenced this issue Oct 20, 2021
@Ralf1108
Copy link
Collaborator

should be fixed in v2.0.144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants