I have code which require me to Pinvoke into a 3rd party native DLL. The issue is that when I use the Nunit test runner for those tests, the native dll is locked by the nunit processes (nunit.exe and nubit-agent.exe). Thus my post-build copy command fails because of this.
The only way to generate a 'successful build' (includes post-build command) is to first close Nunit, rebuild the project and re-open Nunit (Wash, rinse and repeat). This is becoming tedious and frustrating.
Is there any way to force unit to release all handles onto loaded assemblies? I have poked around the NUnit Settings a bit but to no avail.
Side note: The other thoughts I have had are along the lines of how I am actually using this 3rd party dll ( it's actually the C# SWIG version of QuantLib). So there actually may be issues with the wrapper C# code and the IDisposable pattern used (based on a comment I received on another question).