无法在 IIS Express 中启动 asp.net 核心网络应用程序

Cannot launch asp.net core web app in IIS Express

[编辑] 问题是 BitDefender 防病毒。 我按照有关如何安装 asp.net 5 beta 8 的说明进行操作。我能够毫无问题地安装所有必需的文件。但是,每次我 select 编辑 Web 模板并尝试 运行 使用 IIS Express 时,它会在显示错误之前加载几分钟:HTTP 错误 502.3 - 网关错误... 我尝试了此 guide 中的所有故障排除步骤,但没有成功。我检查了我的事件日志并注意到以下两个条目:

The directory specified for caching compressed content C:\Users...Files\Clr4IntegratedAppPool is invalid. Static compression is being disabled.

还有:

The description for Event ID 1001 from source HttpPlatformHandler cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Process '4528' started successfully and is listening on port 'x'.

我不完全确定这些警告/信息是否与我的问题有关。如果有人能阐明这一点,那就太好了。我所知道的是我已经安装了 HttpPlatformHandler。

我决定尝试另一个 visual studio 模板(空白模板),奇怪的是它起作用了。然后我创建了一个新的 Web 应用程序并尝试了项目属性并注意到当我勾选复选框时:"Use Specific Runtime" 和 select x64 架构一切正常!! :) 但是,当未勾选复选框(默认)或复选框为 selected 且体系结构设置为 x86 时,我会遇到同样的旧错误。

如何使用默认设置将其设置为 运行?还是我在这里遗漏了什么?

这是我的 project.json 文件

{
  "webroot": "wwwroot",
  "userSecretsId": "aspnet5-WebApplication3-1a336a00-1f3e-432d-928e-f2669c4b0d94",
  "version": "1.0.0-*",

  "dependencies": {
    "EntityFramework.Commands": "7.0.0-beta8",
    "EntityFramework.SqlServer": "7.0.0-beta8",
    "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta8",
    "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta8",
    "Microsoft.AspNet.Authentication.Google": "1.0.0-beta8",
    "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta8",
    "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta8",
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta8",
    "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta8",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta8",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
    "Microsoft.AspNet.Mvc": "6.0.0-beta8",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta8",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta8",
    "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta8",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
    "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta8",
    "Microsoft.Framework.Logging": "1.0.0-beta8",
    "Microsoft.Framework.Logging.Console": "1.0.0-beta8",
    "Microsoft.Framework.Logging.Debug" : "1.0.0-beta8",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta8"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel",
    "ef": "EntityFramework.Commands"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ],
  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
  }
}

这是我尝试过但没有成功的方法:

  1. 已在安全模式下启动 Visual Studio。
  2. 清除了 Visual Studio 缓存。
  3. 已修复 Visual Studio 2015 年。
  4. 卸载然后重新安装 Visual Studio 2015。
  5. 完全格式化我的电脑并重新安装它。

一些其他信息:

使用 dnx web 或 dnx-watch web 从命令提示符启动您的应用程序,或者 select VS2015 这样做。

查看控制台 window 是否有任何错误。

HTTP Error 502.3 - Bad Gateway

如果您使用 dnx web,您只会在屏幕上看到这些错误。

我也遇到了这个错误。这是由 EF 中的错误引起的。如果由于 kestrel 停止响应而导致 IIS express 无法再与 kestrel 通信,则可能会出现此错误。

通过 运行 dnvm use 确保 select 正确的 dnx 版本。要显示可用的 dnx 版本列表,请使用 dnvm list

:\git\Other\Templates\test\Microsoft.Web.Templates.StarterWeb.AI.IndividualAuth.Tests>dnvm 列表

Active Version         Runtime Architecture OperatingSystem Alias
----- -------         ------- ------------ --------------- -----
  1.0.0-beta8     clr     x64          win
* 1.0.0-beta8     clr     x86          win             b8
  1.0.0-beta8     coreclr x64          win
  1.0.0-beta8     coreclr x86          win
  1.0.0-rc1-16110 coreclr x86          win
  1.0.0-rc1-final clr     x64          win
  1.0.0-rc1-final clr     x86          win             rc1
  1.0.0-rc1-final coreclr x64          win
  1.0.0-rc1-final coreclr x86          win
  1.0.0-rc2-16177 clr     x64          win
  1.0.0-rc2-16177 clr     x86          win             rc2
  1.0.0-rc2-16177 coreclr x64          win
  1.0.0-rc2-16177 coreclr x86          win
  1.0.0-rc2-16219 clr     x86          win
  1.0.0-rc2-16219 coreclr x86          win
  1.0.0-rc2-16222 clr     x86          win             default
  1.0.0-rc2-16222 coreclr x86          win

所以我终于找到了问题的原因。

我在计算机上安装了 BitDefender 防病毒软件,但出于某种奇怪的原因导致了此行为。正如原文 post 中提到的,我确实尝试过禁用它,但没有用。我不得不完全卸载软件:(

浪费时间:(