MethodBoundaryAspect.Fody - LogAspect decoration not working when inside another Nuget

209 Views Asked by At

Well, I'm trying to make a Nuget just to simplify the process to Log in Azure Insights.

I'm using Serilog, MethodBoundaryAspect and default Microsoft logging libraries to make my package, the idea was just to use the decoration instead of writing logs in the begining and the end of each method.

Order of facts:

  1. When the Logging project was inside my solution, all worked just fine.

  2. Generated Nuget from this Logging Project.

  3. Removed Logging project from my solution, and used the Nuget instead.

  4. LogAspect Annotation stopped working, all the rest is working fine.

Notes:

  1. I already tried using the "MethodBoundaryAspect.Fody" in my main project, the FodyWeavers.xml was created, but no change.
  2. Tried to change the properties of the xml to be copied in build, no change.

Here is the GIT with the code: https://github.com/eduardorauchbach/Rauchtech.Logging/

( please, ignore the broken Read.me, looks like github change the coloring again -.- )

Thank you in advance.

1

There are 1 best solutions below

0
Eduardo Rauchbach On

Hint: Remember to aways clean your build before trying things with packages, because you can be tricked to understand that your code work.

The problem here is just that you NEED to have the MethodBoundaryAspect.Fody inside any project that you want the Aspects to work, otherwise the injection will not work, indirect references like I had will not work.