We developed an application that uses Excel interaction libraries (Microsoft.Office.Interop.Excel) to read some Excel files.
When a problem occurs, the Application.ThreadException event is processed, so the resources are freed (Excel is closed ...).
The problem is that when we use the VS debugger, if we stop execution (because the process breaks into an exception or breakpoint, there are many reasons why we do this), the resources will not be released and Excel remains open. And, of course, the next time the application is launched ... it crashes because there are locks in the file.
So I'm looking for a way to force the release of Excel objects, even if it is stopped using the debugger.
Any suggestion?
debugging c # visual-studio
Julien N Jun 23 '09 at 15:47 2009-06-23 15:47
source share