I am invoking an external process by using System.Diagonistics.Process and passing two filenames as parameters. Now some time this process terminates due to exceptions and it seems that files handle are not being released by the process. How can i release the resources occupied by the process.
How are you detecting that file handles are not being released by the dying process?
All resources should be released by a process that dies for any reason. If they aren't, then it is a bug that should be filed with Microsoft.
What is making you think that file handles are not being released? Since you are starting a process which is external to your application you don't have much control over what the other process is going to do when it terminates abnormally.
This application is WMVAppend.exe (available with Microsoft Media SDK). Even when we restart the machines, it report the error dialogue and work fine for the next run. The issue with only media appending which is not done by our process. I also checked the source files and they seem perfect but they are not appended perfectly and files are not available to use.
Or It might be possible that process is not terminated at all, but i am using Process.WaitForExit() which should return only the process is terminated. The error dialog on restart suggests me this case could be possible.