I'try to setup Tracer.Fody and it works perfectly when I add it to one project. However I would like to setup tracer logs for the entire solution and to configure it with only one FodyWeavers.xml. Is it possible to setup Fody only on the Main project and to tell it to weave through the dependencies?
Asked
Active
Viewed 535 times
1 Answers
1
Implement the Decorator in parent project using the module.
[module: RelayExceptions]
[AttributeUsage(AttributeTargets.Method)]
public class RelayExceptionsAttribute : Attribute, IMethodDecorator
{
public void Init(object instance, MethodBase method, object[] args)
{ }
public void OnException(Exception exception)
{
Console.WriteLine(exception.Message);
}
public void OnEntry() { }
public void OnExit() { }
}
In another project that has reference mention [module: RelayExceptions] and it should work
[module: RelayExceptions]
class Test{
[RelayExceptions]
public void AnyMethod()
{
//some code
}
}
NOTE: This worked in MethodDecorator 1.1.0

gnagesh
- 83
- 6