简体   繁体   English

IIS Express 不会在 Visual Studio 2019 中重新启动

[英]IIS Express does not restart in Visual Studio 2019

In general, there is a website( ASP .NET MVC 5 ) that I run in Visual Studio.一般来说,我在 Visual Studio 中运行了一个网站( ASP .NET MVC 5 )。

The first time everything starts clearly, and if you restart the debug session, then the second time it does not start.第一次一切都开始清晰,如果您重新启动调试会话,那么第二次它不会启动。 If you look at the tray, then IIS Express is absent there.如果您查看托盘,则那里没有 IIS Express。

Only restarting Visual Studio solves the problem, but again, only 1 time and you have to restart the studio each time.仅重新启动 Visual Studio 即可解决问题,但同样只有 1 次,并且您每次都必须重新启动工作室。

What could be the problem?可能是什么问题呢?

This happened exactly to me when I upgrade a solution from VS 2010 to VS 2017.当我将解决方案从 VS 2010 升级到 VS 2017 时,这恰好发生在我身上。

I searched for solutions and only found: remove the .vs directory from the solution, remove the IIS Express directory from the documents or reinstall VS.我搜索了解决方案,只发现:从解决方案中删除.vs目录,从文档中删除IIS Express目录或重新安装VS。

The problem was that the solution has multiple web projects that can run.问题是该解决方案有多个可以运行的 Web 项目。 And in one of them, in the .csproj, there was this configuration:其中之一,在 .csproj 中,有这样的配置:

<UseIISExpress>false</UseIISExpress>
<UseIIS>False</UseIIS>

When I set it to true, the problem was gone.当我将其设置为 true 时,问题就消失了。

Regards.问候。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM