You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented a custom test event listener (by using the ITestEventListener extension point). So far it works well, the event listener is loaded and the events are triggered as expected.
However, I observed that I cannot use static types in both the event listener and the test libraries. I also observed that for net47 target, the test case and the event listener run in different appdomains and i guess thats the root cause (its well-known that its not possible to share static instances across appdomains).
I run the tests with vstest + test adapter or with dotnet test.
Running the same test in ReSharper works fine because ReSharper uses the same appdomain for both the test and the custom event listener, but has also a self-implemented test adapter with probably some magic inside.
Is there any way to overcome that my custom eventlistener is loaded into a separate appdomain?
Unfortunately I still have to target net47.
Thanks and best regards!
I use
nunit 3.11
nunit.engine 3.9
nunit3 test adapter 3.13
but it seems pretty much independent from the concrete versions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I implemented a custom test event listener (by using the ITestEventListener extension point). So far it works well, the event listener is loaded and the events are triggered as expected.
However, I observed that I cannot use static types in both the event listener and the test libraries. I also observed that for net47 target, the test case and the event listener run in different appdomains and i guess thats the root cause (its well-known that its not possible to share static instances across appdomains).
I run the tests with vstest + test adapter or with dotnet test.
Running the same test in ReSharper works fine because ReSharper uses the same appdomain for both the test and the custom event listener, but has also a self-implemented test adapter with probably some magic inside.
Is there any way to overcome that my custom eventlistener is loaded into a separate appdomain?
Unfortunately I still have to target net47.
Thanks and best regards!
I use
nunit 3.11
nunit.engine 3.9
nunit3 test adapter 3.13
but it seems pretty much independent from the concrete versions.
Beta Was this translation helpful? Give feedback.
All reactions