.net - How to force Nunit to release handles on native DLLs? -
i have code require me pinvoke 3rd party native dll. issue when use nunit test runner tests, native dll locked nunit processes (nunit.exe , nubit-agent.exe). post-build copy command fails because of this.
the way generate 'successful build' (includes post-build command) first close nunit, rebuild project , re-open nunit (wash, rinse , repeat). becoming tedious , frustrating.
is there way force unit release handles onto loaded assemblies? have poked around nunit settings bit no avail.
side note: other thoughts have had along lines of how using 3rd party dll ( it's c# swig version of quantlib). there may issues wrapper c# code , idisposable pattern used (based on comment received on question).
you can use command line option tool unlocker release handles. or load pinvoke functions separate app domain , release domain.
edit:
in second case. when create appdomain , load assembly p/invokes domain, don't load assembly primary app domain. when testing finished unload app domain. see here example. once the domain unloaded p/invoked dlls should released too.
Comments
Post a Comment