It seems there are questions close to this, but none I have seen involve the actual .Net Process object. Currently, I am using a Process object to start an external executable and read data from it in C#. This happens once for each collection point that I must monitor data for. However, when I have to monitor 5 or more collection points my process for the fifth collection point is killed before I can collect any data from it. The code used to start the Process object is list below. Any help is appreciated.
procCollectionMonitor = new Process();
procCollectionMonitor.StartInfo.FileName = options.CollectionMonitorProcessPath;
procCollectionMonitor.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(options.CollectionMonitorProcessPath);
procCollectionMonitor.StartInfo.ErrorDialog = false;
procCollectionMonitor.StartInfo.UseShellExecute = false;
procCollectionMonitor.EnableRaisingEvents = true;
procCollectionMonitor.Exited += spawn_Exited;
procCollectionMonitor.Start();
This application is a Windows Service, that runs on Windows Server 2008 R2. As I said before, this issue only occurs when 5 or more collection points are started. Instances where 4 or less are needed have no problems.