Diagnostics.Process cannot be disposed completely


i've had strange issue couple of weeks , still can't find solution.

i'm working on test tool in c# (using .net 3.5) our application runs on remote computer. able update source , start vs build , run our program while monitoring state , send information server. scheduled tasks done python scripts, testtool responsible maintaining list of scripts , run them using system.diagnostics.process. python scripts can start other programs (svn.exe, devenv.exe). tool creates system.runtime.remoting.channels.tcp.tcpchannel instance through communicates monitoring clients runs e.g. on local computer.

the strange issue when close testtool , has run python script launched process (svn or vs). though call kill() , dispose() on running process , python stop, other process started py python keeps running , thats thing me, there's no problem that. problem occurs when want restart testtool sais can't create tcpchannel because there exist 1 port. can manage restart after killing svn or vs manually in task manager, , that's bad cause still want monitor running instance of studio.

i don't know whether understandable, unfortunately can't paste code, rather seems architectural problem. think there must in gcing objects i'm not aware of. however, i'm learning c# , .net not first time when struggle unmanaged resources.

thx in advance.

that's caused child process inheriting handles of parent process. unfortunately process class doesn't have option prevent this, you'll have pinvoke win32 createprocess function.


.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'