views:

346

answers:

6

I have a console application, that when I run (from within vs.net) it takes a while as it is a long running process.

I want to continue coding in vs.net, and maybe even spawn multiple instances of the console application.

How to best deploy this on my desktop cmputer?

Is this a good approach:

create a folder: /myConsole/ then subfolders for each instance.

Do I just grab all fines in the /debug folder or are there other dependancies?

+5  A: 

If you run without attaching the debugger you can continue coding while the program runs.

Debug Menu | Start without debugging, or Ctrl+F5

Note: using this method, you can compile the modified code, but cannot run it since the .exe output file will be in use. I'm not sure if that's a problem for you.

Jon Seigel
But you run into the issue that when you try to compile again you'll get an error that the files cannot be copied because they are in use.
Agent_9191
Only when it tries to link and output the .exe. You can still compile the code without a problem. I will add that to my answer.
Jon Seigel
A: 

You should consider executing your code through system tests in a unit test console like the one that Resharper offers. It does shadow copying for you and allows you to nicely run multiple sessions, start/abort them etc. I think this is far more clean and flexible than firing up test apps all over the shop.

Alex
+1  A: 

One way I've done it before is to create a release build from VS. Then open as many command prompts as you need on the release folder and then run it from there. Then I change back to debug build and continue coding. This lets me run the separate instances and also debug if need be and it's all as simple as changing the type of build in VS.

TskTsk
A: 

If you dont need to have the debbuger attach, what about just going to your /bin folder and double clinking on the exe, as many times as instances you want open?

If you DO need to have the debugger attached.. then the only way I can think about it is to have multiple instances of VS running, each with the debugging on :S

Francisco Noriega
A: 

In general, there aren't any dependencies outside of your bin\debug directory. If you want to test this long-running program while you're still coding and re-compiling, you'll want to copy the contents of the bin\debug directory somewhere else, and run it from there.

Whether or not you can run separate instances from the same directory depends on how the program deals with output files or other resources. If the name of any output file is hard coded, then you'll have to run multiple instances from separate directories. If you can specify files on the command line, then you can run as many instances as you like from within a single directory.

Jim Mischel
A: 

You should be able to copy your console application into a separate folder. This would be all the files in the build folder. Then, you can just run it like any other exe. If you are not sharing settings / data in the application folder, you can run the application as many times as you like. Windows is quite happy to run a number of instances of the same exe.

If you wanted to automate, you could copy the application out of the build folder in a build event...

Scott P