[英]ASP.NET Core 6: how to bring the console window to the foreground upon launch
After creating a new project using the "ASP.NET Core Web App" template, when I run the project, I want the console window to automatically be brought to the foreground.使用“ASP.NET Core Web App”模板创建新项目后,当我运行项目时,我希望控制台 window 自动被带到前台。 Since I'm mainly developing a web API, I don't want the browser to launch (which I've done in launchsettings.json), but do want the console window to show.
由于我主要开发 web API,我不希望浏览器启动(我已经在 launchsettings.json 中完成),但希望控制台 window 显示。
I've verified that this is the default behaviour when creating a .NET Core 6 Console app , yet I can't find the settings responsible for this desired behaviour.我已经验证这是创建 .NET Core 6控制台应用程序时的默认行为,但我找不到负责此所需行为的设置。
It can be achieved easily just by changing a debug setting.只需更改调试设置即可轻松实现。 It may be a little bit different in old versions of Visual Studio!
在旧版本的 Visual Studio 中可能会有点不同!
VS2022
VS2022
1. Open Launch Profiles window: 1. 打开启动配置文件 window:
2. Select relevant profile from opened window and change Launch browser setting(uncheck it) 2. Select 相关配置文件从打开的 window 并更改启动浏览器设置(取消选中它)
3. Save the change if there is any Save button. 3. 如果有任何保存按钮,请保存更改。 and run the project.
并运行该项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.