I use for my MVC application a parser for a word document. I noticed that after the parser runs, the document remains in memory. Used method:
Marshal.ReleaseComObject(Doc); Marshal.ReleaseComObject(MSWord);
but it does not help, the object is still hanging in memory. How to delete an object of type System.__COMObject
from memory?
Problem lines:
Word.Application MSWord = new Word.Application(); Word.Document Doc = MSWord.Documents.Open(urlDocMenu, ConfirmConversions: true);
After these lines an object appears in memory and I do not know how to remove it.