process - Unable to start multiple Processes (C#) -


i unable start multiple processes console application. have visual studio solution console application a, must start multiple instances of console application (b).

b runs in loop catching incoming network traffic on port specified in process arguments.

to simplify problem, have removed network logic , made basic possible, yet still have same problem.

code a, test.exe console application b:

   static void main(string[] args)    {         try         {             (int = 0; < 5; i++)             {                 system.diagnostics.process.start(new system.diagnostics.processstartinfo { filename = "test.exe" });                                }          }         catch (exception ex)         {             console.writeline("error: " + ex.message);         }      } 

code b:

    static void main(string[] args)     {         int counter = 0;         while (console.keyavailable == false || console.readkey().key != consolekey.escape)         {             console.writeline("" + counter);             system.threading.thread.sleep(1000);             counter++;         }         console.readline();     } 

once run console application in visual studio debug, pops intended, 1 window of b pops starting count specified. however, if in task manager can see in fact 2 test.exe running, 1 using 116k memory , other using 180,000k memory.

once counter reaches 15, closes , opens 2 new windows both starts counting 0. behavior continues, opening new instances of b every time counter reaches 15 until 5 instances running specified in a.

obviously behaviour not intended, want launch b 5 times (in example) without waiting proccesses exit.

after re-installing .net , removing features no longer needed, working intended. starting 50 instances no problem , weird memory usage no longer evident.

the culprit either windows phone sdk or windows azure vs.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -