[英]How to make Kestrel console window auto close/reset upon each rebuild in Visual Studio ASP.NET Core web projects?
I'm using VS 2019. By default most if not all of the ASP.NET Core web projects use IIS Express as the host under Debug settings and launchSettings.json
. I'm using VS 2019. By default most if not all of the ASP.NET Core web projects use IIS Express as the host under Debug settings and launchSettings.json
.
What I tend to do, especially for web API projects, is to delete the IIS Express profile and instead use the "Project" profile/launch option.我倾向于做的,特别是对于 web API 项目,是删除 IIS Express 配置文件,而是使用“项目”配置文件/启动选项。
This simply opens a Kestrel console window upon execution, and I like it how logs etc are shown in the same console for easy diagnostics.这只是在执行时打开一个 Kestrel 控制台 window,我喜欢日志等如何显示在同一个控制台中以便于诊断。
But the problem is, if any code is changed, and I re-build the solution/project (Ctrl+B, Ctrl+Shift+B,Ctrl + F5 etc etc), I get the "Could not copy..." messages in Visual Studio, till I manually close this Kestrel console window.但问题是,如果任何代码被更改,并且我重新构建解决方案/项目(Ctrl+B、Ctrl+Shift+B、Ctrl+F5 等),我会收到“无法复制...”消息在 Visual Studio 中,直到我手动关闭这个 Kestrel 控制台 window。
This is not an issue with the IIS Express profile at all.这根本不是 IIS Express 配置文件的问题。
So how do I make it such that I don't have to manually close that Kestrel window each rebuild?那么我该如何做到这一点,这样我就不必在每次重建时手动关闭 Kestrel window 呢? This seems like a natural/easy thing to do but I just can't find the options.这似乎是一件自然/容易的事情,但我就是找不到选项。
You mean this?你是这个意思?
Tools → Options → Debugging → General → Automatically close the console when debugging stops工具→选项→调试→常规→调试停止时自动关闭控制台
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.