-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
Description
Environment:
- OS: windows
- Framework: net6.0
- Type of application: Nunit Test Application
- Version of AspectInjector: 2.8.1
Describe the bug
Local variables are not visible when debugging synchronous methods when using AspectInjector.
To Reproduce
I am using example from README
[Aspect(Scope.Global)]
[Injection(typeof(AroundTests_Simple))]
public class AroundTests_Simple : Attribute
{
[Advice(Kind.Around, Targets = Target.Method)]
public object AroundMethod([Argument(Source.Target)] Func<object[], object> target,
[Argument(Source.Arguments)] object[] arguments)
{
return target(arguments);
}
}
Use with synchronous test method.
[TestFixture]
public class TestClass
{
[Test]
[AroundTests_Simple]
public void Test()
{
var test = 1;
Assert.True(test == 1);
}
}
But with async method it works correctly:
Additional info:
Old issue for async methods
#71