Open MarcZw opened 3 weeks ago
Would you mind providing more details about the use case you are trying to cover?
At the moment the program (Stryker.NET) does an initial test run of the unit tests to determine whether any tests are failing before mutating the source code. To run these unit tests, the mstest extension needs a reference to an assembly loaded in the default loading context.
After the initial test run has finished, Stryker mutates the source code and tries to inject it in the .dll of the already ran unit tests. Unfortunately this injecting will always fail, because the file is locked by loading the assembly into the default loading context.
After the initial test run has finished, Stryker mutates the source code and tries to inject it in the .dll of the already ran unit tests. Unfortunately this injecting will always fail, because the file is locked by loading the assembly into the default loading context.
Why don't shutdown the app, instrument(I suppose you're rewriting it on disk and you're now using a profiler) and restart it?
Question
Is there a way to unload assemblies using the MSTest.Sdk/3.x.x?
Problem
When registering MSTest via the extension point you need to provide an
Assembly
loaded in the defaultAssemblyLoadContext
. However, after loading thisAssembly
the corresponding .dll file gets locked from any io-operation, which the program needs.See the code below for the current way of loading assemblies
TestApplication