参考博客:https://blog.csdn.net/xinxinsky/article/details/80733400
C++桌面程序设置
Properties -> Build Events -> Post-Build Event -> Command Line -> 输入editbin /SUBSYSTEM:CONSOLE $(OUTDIR)$(ProjectName).exe
测试Debug运行,可以从控制台输出调试信息,但是单独运行该程序时,没有启动控制台C++
C#桌面程序设置
Properties -> Application -> Output Type -> Console Application