nunit-console icon indicating copy to clipboard operation
nunit-console copied to clipboard

Missing method exceptions when running tests in a netcore31 assembly, which uses its own netstandard2.0 assembly loader

Open Ian144 opened this issue 4 years ago • 0 comments

I have a netcore31 test assembly, the application for which uses a netstandard2.0 assembly loader internally. The NUnitNetCore31Driver creates it's own CustomAssemblyLoadContext for loading the test assembly, and a corresponding "EnterContextualReflection" using-block when executing test methods. Is there any way for the netstandard2.0 assembly loader in my application, to use the correct AssemblyLoadContext (ie. the CustomAssemblyLoadContext created by the NUnitNetCore31Driver)? given that netstandard2.0 does not know about AssemblyLoadContext's as they are a netcore31 thing? Currently I'm getting method-missing exceptions, which i think is because some of my applications assemblies are owned by the default AssemblyLoadContext and some are owned by the nunit CustomAssemblyLoadContext.

thanks, Ian

Ian144 avatar May 22 '21 11:05 Ian144