Visual Studio 2017无法使用IIS Express运行核心应用

Visual Studio 2017无法使用IIS Express运行核心应用

问题描述:

我在Visual Studio 2017 RC中遇到问题,当我使用IIS Express运行MVC和/或WebAPI应用程序时,该应用程序实际上从未运行。取而代之的是,我在浏览器中停留在一个页面上,指示该页面正在尝试附加,从那里继续进行下去。如果我在浏览器中打开另一个选项卡/窗口,并尝试直接导航到启动URL,它将永久旋转。同样,当我使用dot net run命令运行该应用程序时,该应用程序将启动并运行良好。

I am having an issue with Visual Studio 2017 RC where when I run an MVC and/or WebAPI app using IIS Express the app never actually runs. Instead I get stuck with a page in the browser indicating it is trying to attach and from there it goes no further. If I open another tab/window in the browser and try to navigate directly to the launch URL, it just spins forever. Likewise when I run this using the dot net run command, the app launches and runs fine.

似乎没有任何错误可以看到,只是浏览器会无限旋转,而无需实际加载页面/端点。

There do not seem to be any errors that I can see, just that the browser spins indefinitely without actually ever loading the page/endpoint.

注意:在大多数情况下,这种情况都会发生。 VS中新创建的项目,没有任何更改,以前版本中的已知工作项目等。

Note: this occurs for most any circumstance. Newly created project in VS with no changes, known working project from previous versions, etc.

您可以关注或投票解决该问题: https://developercommunity.visualstudio .com / content / problem / 11391 / aspnet-core-iis-express-httplocalhost51733-failed.html

You could follow or upvote the issue: https://developercommunity.visualstudio.com/content/problem/11391/aspnet-core-iis-express-httplocalhost51733-failed.html

看起来我们的解决方法是

Looks like our workarounds meanwhile are


  • dotnet运行

  • 发布到本地IIS。

  • (未经测试:从core-1.1降级为core-1.0)

如果您不熟悉VS2017 / asp.net:

If you aren't familiar with VS2017/asp.net:

您已经拥有或可以通过查看菜单显示$ c>-> 其他工具栏

You have, or can reveal via View Menu-->Other Toolbars :

调试工具栏-> dropdowncombobutton [绿色箭头>] IIS Express


  • 单击按钮的下拉箭头部分。

  • Click on the dropdown downarrow part of the button.

您应该看到运行{yourprojectname} 选项。
这等效于在命令行中运行 dotnet {yourprojectname}

You should see a Run {yourprojectname} option. This is the equivalent of dotnet run {yourprojectname} from the commandline.

您可以配置下拉菜单中显示的选项,

You can configure the options that appear in the dropdown with

右键单击在解决方案资源管理器中的项目上-> 属性-> Debug