c# - Executing Process.Kill code when WCF service is being disposed -


i have wcf service hosted on iis, references legacy tool, via com interface. legacy tool black box me, can't change code or fix bugs in it. when restart wcf service, or stop via iis management tool, referenced legacy tool should shut down well, along other unmanaged data uses, , start again on first call restarted wcf service.

everything works fine, except 1 function call on legacy tool. if call specific function, there bug inside tool, prevents going down, if stop wcf service.

i thought workaround in i'll call process.kill function every time wcf service app being disposed. difficulty can't find suitable place call it.

first tried make service behavior class inherit idisposable, , implement dispose method. problem dispose called every time function finished it's flow, can't kill legacy tool every call of course.

my wcf service communicates client app via net pipe channel, understand, can't use global.asax file.

my question - suitable place call process.kill code, if want called once, when whole wcf service application being disposed.

thanks.

at end, solved problem calling kill process code in static constructor of service behavior. constructor called once percall context mode, me has same effect if called code on dispose phase in single context mode. of you.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -