Running IIS AppPool Utility in WCF Service

I am working on a web service that interacts with an unstable third-party C ++ DLL.

It often throws AccessViolationException(i.e. a failure in the DLL), and the only way to recover is to restart the application pool.

Is there a way to programmatically recycle an application pool?

Note. I tried to change the timestamps of my .NET DLL and web.config, but this does not seem to be enough for the w3wp.exe process to unload its own C ++ DLL. I cannot touch the C ++ DLL because it returns with the error: "DLL is being used."

+5
source share
1 answer

If you have access to this window, you can use appcmd.exe:

C:\dev>\windows\system32\inetsrv\appcmd.exe apppool  /?
Administration of application pools

APPCMD (command) APPPOOL <identifier> <-parameter1:value1 ...>

Supported commands:

  list      List application pools
  set       Configure application pool
  add       Add new application pool
  delete    Delete application pool
  start     Start application pool
  stop      Stop application pool
  recycle   Recycle application pool

(To get help for each command use /?, e.g. 'appcmd.exe add site /?'.)

, System.Diagnostics.Process .

0

All Articles