简体   繁体   English

ASP.NET Core 6:如何在启动时将控制台 window 带到前台

[英]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.

相关问题 如何在 Visual Studio ASP.NET Core web 项目中的每次重建时使 Kestrel 控制台 window 自动关闭/重置? - How to make Kestrel console window auto close/reset upon each rebuild in Visual Studio ASP.NET Core web projects? 控制台窗口中的ASP.Net Core App输出? - ASP.Net Core App Output in a Console Window? VS2022:如何让 ASP.NET Core 5 应用程序显示它的控制台窗口 - VS2022: how to make ASP.NET Core 5 app show it's console window 如何在Asp.net Core中注册时添加用户角色 - How to add user roles upon registrations in Asp.net Core 如何使用 IIS Express 在 ASP.NET Core 中获取控制台输出 - How to get a Console output in ASP.NET Core with IIS Express 在控制台asp.net Core上记录结果 - Log the result on the console asp.net Core ASP.NET Core 3 登录到 output window - ASP.NET Core 3 logging to output window ASP.NET Core-执行命令后找不到密钥 - ASP.NET Core - Key Not Found Upon Execute Command 在 ASP.NET Core 中的 SignalR 中重新连接时重新连接到组 - Reconnect to groups upon reconnection in SignalR in ASP.NET Core ASP.Net核心依赖注入|如何在创建时访问用户或路由数据 - ASP.Net Core dependency injection | How to access user or route data upon creation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM