[英]VS2022: how to make ASP.NET Core 5 app show it's console window
In VS2019, when I start my ASP.NET Core 5 app, which just exposes an API, if that matters, a console window pops up for that app.在 VS2019 中,当我启动我的 ASP.NET Core 5 应用程序时,它只公开一个 API,如果这很重要,则会为该应用程序弹出一个控制台窗口。 There used to be some setting to decide whether to run it as a console / standalone app or host it in IIS Express.
曾经有一些设置来决定是将其作为控制台/独立应用程序运行还是在 IIS Express 中托管。 I always preferred the console / standalone version because it lets me see the logs in realtime.
我一直更喜欢控制台/独立版本,因为它可以让我实时查看日志。
In VS2022, when I start the very same project, no window appears at all, and, interestingly, neither do I see IIS Express starting up.在 VS2022 中,当我启动同一个项目时,根本没有窗口出现,有趣的是,我也没有看到 IIS Express 启动。
How can I get back to having the project start as a console app?我怎样才能回到让项目作为控制台应用程序启动的状态? (Except starting it from the command-line and then attaching the debugger.)
(除了从命令行启动它然后附加调试器。)
UPDATE:更新:
ok, so at long last I noticed that, strangely, a minimized console window is being created and because I start a dozen projects (microservices), I didn't notice before, and procexplorer telling me that the executable had no window added to the confusion.好的,所以最后我注意到,奇怪的是,正在创建一个最小化的控制台窗口,因为我启动了十几个项目(微服务),我之前没有注意到,并且 procexplorer 告诉我可执行文件没有窗口添加到困惑。 So this is much less problematic, albeit still weird - why does this one particular application not start un-minimized?
所以这问题要小得多,尽管仍然很奇怪——为什么这个特定的应用程序没有以未最小化的方式启动? The only difference it has to all the other executables is that it uses ASP.net core while the others (all background services communicating via messagequeue) don't.
它与所有其他可执行文件的唯一区别是它使用 ASP.net 核心,而其他(所有通过消息队列进行通信的后台服务)则不使用。
and this only in VS2022, in VS2019 all executables including this one start unminimize这仅在 VS2022 中,在 VS2019 中,包括这个在内的所有可执行文件都开始取消最小化
You have to make sure, that you selected "IIS Express" as your debug profile您必须确保您选择了“IIS Express”作为您的调试配置文件
In Visual Studio 2022 this is currently NOT POSSIBLE在 Visual Studio 2022 中,这目前是不可能的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.