aspnet_wp.exe seems to have trouble letting go of dlls

C

cssnow

I'm doing a PInvoke call to a c++ dll in a web service. I'm able to do
the PInvoke call 1 time successfully. The next time I call it and
every time after that I get an exception "null reference".

The reason I think that aspnet_wp.exe is the root of this problem is
because I can get my PInvoke call to work again by resetting IIS which
shuts aspnet_wp down. When I do the iisreset I get this message:

"aspnet_wp.exe - Application Error. The instruction at ### referenced
memory at ###. The memory could not be read. Click OK to terminate."

What I think is happening is that the thread which makes the first
PInvoke call loads the dll successfully, and makes the call, but for
some reason it can't unload the dll. That explains the exception I see
when I try to PInvoke it again. Then when I reset IIS aspnet_wp shuts
down. Aspnet_wp then tries to close all of it's running threads which
includes the one that is hanging while trying to unload my dll, and
that's when I get this error message.

What do you think of my theory, and why would aspnet_wp choke on my
dll??
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top