I’m writing a command-line application in .Net. The app itself is fairly simple, but it has to connect synchronously to a web-service, which in turn has to connect to a Oracle database, and those pieces are fond of taking their time.
Is there a straightforward way (without dividing my app exe in two) to continue executing but nonetheless yield execution to the command prompt?
It’s Windows, so no “&”. Also, I cannot use cmd.exe’s “start” cmdlet.
I don’t believe it’s possible without running a background process from your application. However, a fairly clean way to do so might be to modify your Main method like so:
Something like that anyway, just writing this off the top of my head. Basically, it creates a new instance of the same executable, but the new process sees the “run” command line argument and does the work rather than spawning a new instance. Setting the options I have “should” allow the spawned process to print to the existing Console as well.