Ich habe ein echtes Problem, während die Excel.Application()
nicht freigegeben werden will, egal was. Auch nachdem eine neue Klasse sofort instanziiert und entsorgt wird, erscheint sie immer noch in der Prozessliste.Wie Sie die Excel.Application-Klasse richtig entsorgen
if (_ExcelApp == null)
_ExcelApp = new Microsoft.Office.Interop.Excel.Application();
Dispose();
public void Dispose()
{
if (_ExcelApp != null)
{
try
{
_ExcelApp.Quit();
Marshal.FinalReleaseComObject(_ExcelApp);
}
catch (Exception) { }
_ExcelApp = null;
}
}
Bitte helfen!
[Verwandte?] (Http://stackoverflow.com/questions/27930307/why-does-microsoft -office-interop-excel-application-quit-leave-the-background) – stuartd
Überprüfen Sie diese [Frage] (http://stackoverflow.com/questions/9962157/safely-disposing-excel-interop-objects-in-c) – shadow
Überprüfen Sie diese http://stackoverflow.com/questions/158706/how-to-properly-clean-up-excel-interop-objects –