views:

30

answers:

1

Hi,

I have a webservice and I noted that some dlls in the wwwroot folder are kept logged after the webservice is executed.

After restart of pc, the problem is solved.

Can i have something in my code that releases the dlls?

+1  A: 

Try to either recycle the AppPool which your webservices runs under, or use iisreset.

iisreset /stop will stop IIS and release the dll's. iisreset /start will start IIS back up again.

If you recycle the Application Pool, then the lock of dll's will be released until someone hits your webservice again, and aquires a new lock.

Mikael Svenson
can I do this in my C# code?
mouthpiec
@mouthpiec - you can maybe restart the *app pool* from your C# code if you use ADSI and your code is not running under the same app pool. But don't try restarting the IIS instance from your code, especially if your code is running in that IIS version (your code will effectively be shutting itself down). An iisreset is an administrative type task, and should always be done manually, you may have to plan ahead if you need to do it and others are using the server.
slugster
@mouthpiec - Can you describe your scenario for why you want to unlock the dll's? Then it's easier to advise on the route to go.
Mikael Svenson