Excel instance remains after closing, calling GC, setting to null

J

John Bailo

I wrote a c# web service that creates an Excel spreadsheet. Even
though I follow all the formal procedures for closing the app and
finalizing, an instance of Excel still remains in memory.

I follow the procedures described here:

http://blogs.geekdojo.net/richardhsu/archive/2003/11/14/281.aspx

Yet, excel.exe stays there with IUSR_ as the owner.

I'm trying to get rid of this instance once the method ends.

BTW -- if I use the exact same code in a c# console application, the
instance does go away!
 
M

Mark Fitzpatrick

You're also positive you're clearning all the com references as mentioned in
the comments to that entry. Keep in mind, Excel should never really be used
on the server. It's not designed to be called from ASP.Net or a web service.
It's the wrong threading model. You can end up with numerous copies of Excel
running and MS doesn't recommend this at all. There are lots of third-party
components that are written in managed code and may do what you need.
Personally, I've used the one from Component1 but there are lots of others
out there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top