Excel interop libraries incompatible with ASP.NET?

孤街醉人 提交于 2019-12-06 06:19:09

I'm not sure this is exactly an answer but I have worked a lot with ASP.NET and Excel Interop and can offer you some of my observations / pointers.

If you use Task Manager you can see which user is still running EXCEL.EXE process - it's most likely the AppPool Identity.

From experience when the app pool recycles this will close Excel.

Also you may notice that if you run your script again a second Excel opens and will close!

For reference, here is my Close Excel code:

xl.Quit();
Marshal.ReleaseComObject(xl);
xl = null;
GC.Collect();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!