I'm building a text-based MUD game. I can run the game from a normal cmd prompt but I want to run it through the VS 2019 debugger so I can test changes made to the code in real time. The problem is VS 2019 is parsing the exe file differently than the cmd prompt and closes the process after the debugger runs. When I do a diffcheck on the outputs from VS 2019 vs cmd prompt they are almost identical except for 2 parts.
cmd prompt output not shown in the VS output
<code>
:: ipv6 support not enabled, ignoring: 'telnet://[::]:+0'
:: socket 492 listening as telnet on 0.0.0.0:4000.
:: ipv6 support not enabled, ignoring: 'http://[::]:+1'
:: socket 500 listening as http on 0.0.0.0:4001.
:: Starting hostname/ident resolver process...
:: [*****] BUG: C:\Dawn Of Time\DAWNTEST\dawntest\resolver.exe not found!
:: *************************************************************************
Resolver.exe is used to convert IP addresses into domain names (seen using
the sockets command). Currently the gamesetting flag
'perform_local_dns_lookups' is turned off, so there is no IP to domain name
conversion. You can turn this on within gameedit so the translation of IP
address to domain names will be performed by the mud itself. The only down
side of turning on this option is that when the mud looks up the domain name
of an ip address, it waits for the answer. If the IP doesn't have a domain
name, the mud will stall for all players until the lookup it times out after
about 30 seconds.
:: Querying resolvers version.
</code>
end of cmd prompt output
<code>
:: We are running on DESKTOP-1UI98DM.
:: The current working directory is C:\Dawn Of Time\DAWNTEST.
:: The hostname/ident resolver is not currently running.
:: PlatformID: WindowsNT v6.2.9200 []
:: Free stringspace =607349.
:: Dawn v1.69r based mud on DESKTOP-1UI98DM is ready to rock.
:: Logging to logs\game\4000-211002-04.log
:: Mud is running in the foreground with a process id of 24592
:: Pressing ctrl+c will terminate the mud process (unless you have hotrebooted)
:: installing atexit and signal handlers
:: The mud is waiting for connections on the following addresses:
:: s492> telnet port: 4000, ipv4 address: 0.0.0.0
:: s484> http port: 4001, ipv4 address: 0.0.0.0
:: Updating Areas
Sat Oct 2 10:19:09 :: Tick
</code>
end of VS 2019 console output
<code>
:: We are running on t\Debug\dawntest.exe.
:: The current working directory is C:\Dawn Of Time\DAWNTEST.
:: The hostname/ident resolver is not currently running.
:: PlatformID: WindowsNT v6.2.9200 []
:: Boot test completed OK!!!
C:\Dawn Of Time\DAWNTEST\dawntest\Debug\dawntest.exe (process 7116) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
</code>
As you can see, when I execute the exe from the cmd prompt it loads and then the process continues to run. In other words, the game continues to run until I close it. But when I execute the code in the debugger I get "Boot test complete OK!!!" and the process exits with code 0. I need a way to run the process through the VS console and remain open and running instead of closing out.
Can you help me with this?