6

Is there an easy way to do this?

I am testing my networking application using just the console for now. What would be nice is to have multiple consoles from one project and one press of the "Debug Now" menu item.

I could, like I have in the past, use multiple projects but that's seems unwieldy. Ideally I could launch multiple console instances (running from the same thread is fine) and have them not cover the other consoles when they do launch. Launching side by side would be awesome!

How practical is what I'm asking? Is it possible?

Thanks!

bobber205
  • 12,948
  • 27
  • 74
  • 100
  • So you're looking to launch/debug a single project by having it launch multiple instances of `cmd`, but not having them overlap each other? – Agent_9191 Dec 14 '09 at 18:40
  • That is what I want. Ideally there was be two main procedures called, each tied to a different console. – bobber205 Dec 14 '09 at 18:45

3 Answers3

6

There is no easy way to do this.

Technically, you can create a separate console for an application, but it requires creating a child process to host the console. There is a CodeProject article showing the basic procedure.

That being said, at the point where you want multiple "windows" showing data, I think migrating to a (simple) GUI application is a better choice.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • That's what I've thought for awhile. Wanted to avoid it but looks like I can't. – bobber205 Dec 14 '09 at 18:44
  • Well, there is a way to do it. Read the article - it lets you have a single process, and you use child process instances just for the console (but not the logic). It's clunky, but works. – Reed Copsey Dec 14 '09 at 18:47
1

You could build & start a master application that runs and positions your test applications. See what the System.Diagnostics.Process class can do for you.

The real problem however is in debugging multiple instances of the same app at once. I'm not sure that that is possible.

H H
  • 263,252
  • 30
  • 330
  • 514
0
System.Diagnostics.Process.Start("MyOtherProgram.exe");
ChaosPandion
  • 77,506
  • 18
  • 119
  • 157