How can I start the cleanup method after the debugger stops?

I created a bunch of unit tests for my library that manage a specific .html file. I want to backup the file before the tests, and then restore it when the tests are over. I use the AssemblyCleanup attribute for the recovery part, which works very well. The only problem is that when I stop the debugger manually, the cleanup code does not execute and my file does not recover ... Any tips?

+4
source share
1 answer

You cannot handle process termination from a terminated process. Your only option is another process that respects the completed process.

Re-modifying the code to clear at startup will probably be a lot easier.

+3
source

All Articles