简体   繁体   English

如何在 Visual Studio 2019 中带回 IIS Express 进行调试?

[英]How to bring back IIS Express for Debugging in Visual Studio 2019?

I recently had to unload a project and reload it to fix a bug but now I dont have the option to start my code via IIS express anymore - instead it just says "Any CPU".我最近不得不卸载一个项目并重新加载它以修复一个错误,但现在我没有选择通过 IIS express 启动我的代码 - 而它只是说“任何 CPU”。 在此处输入图像描述

It used to say IIS Express (Google Chrome) and I can launch my web app through that but now it is gone and even going through the Web settings for debugging didn't fix it:它曾经说 IIS Express (Google Chrome),我可以通过它启动我的 web 应用程序,但现在它已经消失了,甚至通过 Web 设置进行调试没有修复它: 在此处输入图像描述

How can I bring back IIS Express so I can run my code properly again?如何恢复 IIS Express 以便我可以再次正确运行我的代码?

Sounds like you need to exit, and then re-load VS.听起来您需要退出,然后重新加载 VS。 If not, then I would repair it.如果没有,那我会修理它。

I would also consider (yes, I know.!!) a reboot of your computer to flush out any running copy of IIS express.我还会考虑(是的,我知道。!!)重新启动计算机以清除 IIS express 的任何运行副本。

The setting (choice) of what browser should be to the right in your menu like this:浏览器的设置(选择)应该在菜单的右侧,如下所示: 在此处输入图像描述

So, clicking on that down arrow (chevron) in your start button should drop a list of options to choose which browser.因此,单击开始按钮中的向下箭头(V 形)应该会下拉一个选项列表来选择哪个浏览器。

While I didn't find a solution, and rebooting it didn't work or pressing the chevron drop down button (it didn't show anything), I have learned you can right click the program in the scaffolding, go to debug, and then "start a new instance".虽然我没有找到解决方案,并且重新启动它不起作用或按下 V 形下拉按钮(它没有显示任何内容),但我了解到您可以右键单击脚手架中的程序 go 进行调试,并且然后“启动一个新实例”。 This would launch your local host for the web program to run and it works fine.这将启动您的本地主机,让 web 程序运行并且运行良好。

You can then go to settings and set a hot key /shortcut for it to work which is what I did.然后,您可以将 go 设置为设置并设置热键/快捷方式以使其工作,这就是我所做的。 While it didn't bring the IIS option back to run, it allows me to run my web program again that way.虽然它没有使 IIS 选项重新运行,但它允许我以这种方式再次运行我的 web 程序。

I research the issue and found a couple of ways to bring the IIS Express option back.我研究了这个问题并找到了几种方法来恢复 IIS Express 选项。

You could try the approaches below one by one.您可以一一尝试以下方法。

Approach-1方法一

In Visual studio 2019, select the solution (.sln)-> Properties .在 Visual Studio 2019 中,select解决方案(.sln)-> Properties Select the drop-down Single Start-up project . Select 下拉单启动项目 select your project from the dropdown. select 从下拉列表中选择您的项目 Click OK .单击确定

It should bring back the IIS Express option.它应该带回 IIS Express 选项。

Approach-2方法二

In Visual studio 2019, Go to Tools -> Customize -> Commands tab, then click on the toolbar radio button and choose the standard option from the drop-down and delete one of the existing toolbar inside the standard toolbar and then choose the option reset all .在 Visual Studio 2019 中,Go 到工具->自定义->命令选项卡,然后单击工具栏单选按钮并从下拉列表中选择标准选项,然后删除标准工具栏中的现有工具栏之一,然后选择选项重置所有.

在此处输入图像描述

Helpful references:有用的参考资料:

  1. Can't debug asp.net core api in visual studio 2019 (No button IIS Express) 无法在 Visual Studio 2019 中调试 asp.net 内核 api(无按钮 IIS Express)

  2. Visual studio 2019 debugging option IISExpress is gone from drop down Visual Studio 2019 调试选项 IISExpress 已从下拉列表中消失

  3. IIS Express hidden issue IIS 快递隐藏问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2019“无法连接到 web 服务器‘IIS Express’” - Visual studio 2019 “Unable to connect to web server 'IIS Express'” 从 Visual Studio 2019 运行时在 IIS Express 上获取 NullReferenceException - Getting NullReferenceException on IIS Express while running from Visual Studio 2019 Visual Studio IIS调试错误 - Visual Studio IIS Debugging error 在带有 SpaServices 和 Visual Studio 的 IIS Express 中启动时,如何防止我的本地主机端口在调试时发生变化? - How do I prevent my localhost port from changing while debugging when launching in IIS Express with SpaServices and Visual Studio? Windows 10 Visual Studio 2019 IIS Express 无法启动并出现错误 500 - Windows 10 Visual Studio 2019 IIS Express won't start with error 500 使用 Visual Studio 2019 调试未来日期 - Debugging future dates using Visual Studio 2019 Visual Studio 2019 中的调试问题 - C# - Issues with debugging in Visual Studio 2019 - C# 在Visual Studio 2010中进行调试时如何设置IIS? - How do I setup IIS when debugging in Visual Studio 2010? 调试时 Visual Studio 2019 死机 - Visual studio 2019 freezes when debugging 使用Visual Studio IIS Express将VSCode调试器附加到.NET Core应用程序调试 - Attach VSCode debugger to .NET Core app debugging with Visual Studio IIS Express
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM