简体   繁体   English

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

[英]Cannot launch asp.net core web app in IIS Express

[Edit] The problem is BitDefender anti virus. [编辑]问题是BitDefender反病毒。 I followed the instructions on how to install asp.net 5 beta 8. I was able to install all the necessary files without any problem. 我按照如何安装asp.net 5 beta 8的说明。我能够安装所有必要的文件没有任何问题。 However every time I selected the web template and attempted to run it using IIS Express it would load for a couple of minutes before displaying an error: HTTP Error 502.3 - Bad Gateway... I tried all the troubleshooting steps in this guide but was unsuccessful. 但是,每次我选择Web模板并尝试使用IIS Express运行它时,它会在显示错误之前加载几分钟:HTTP错误502.3 - 错误网关...我尝试了本指南中的所有故障排除步骤但未成功。 I checked my event log and noticed the following two entries: 我检查了我的事件日志并注意到以下两个条目:

The directory specified for caching compressed content C:\\Users...Files\\Clr4IntegratedAppPool is invalid. 为缓存压缩内容C:\\ Users ... Files \\ Clr4IntegratedAppPool指定的目录无效。 Static compression is being disabled. 静态压缩正在被禁用。

and also: 并且:

The description for Event ID 1001 from source HttpPlatformHandler cannot be found. 无法找到源HttpPlatformHandler的事件ID 1001的描述。 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'. 进程'4528'成功启动并正在侦听端口'x'。

I am not entirely sure if these warnings / information are related to my issue. 我不完全确定这些警告/信息是否与我的问题有关。 If anyone can shed some light on this that would be good. 如果有人能够对此有所了解那将是好事。 All I know is that I have installed the HttpPlatformHandler. 我所知道的是我已经安装了HttpPlatformHandler。

I decided to try another visual studio template (blank template) and strangely enough it worked. 我决定尝试另一个视觉工作室模板(空白模板),奇怪的是它有效。 I then created a new web application and played around with the project properties and noticed that when I tick the checkbox: "Use Specific Runtime" and select an x64 architecture everything works!! 然后我创建了一个新的Web应用程序并使用项目属性,并注意到当我勾选复选框时:“使用特定运行时”并选择一个x64架构一切正常! :) however when the checkbox is not ticked (the default) or when the checkbox is selected and the architecture is set to x86 I get the same old error. :)但是当没有勾选复选框(默认)或选中复选框并且架构设置为x86时,我得到相同的旧错误。

How do I get it to run using the default settings? 如何使用默认设置运行它? or am I missing something here? 或者我在这里遗失了什么?

Here is my project.json file 这是我的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" ]
  }
}

This is what I've tried since with no success: 这是我尝试过的,但没有成功:

  1. Booted Visual Studio in Safe Mode. 以安全模式启动Visual Studio。
  2. Cleared the Visual Studio cache. 清除了Visual Studio缓存。
  3. Repaired Visual Studio 2015. 修复了Visual Studio 2015。
  4. Uninstalled and then Reinstalled Visual Studio 2015. 卸载然后重新安装Visual Studio 2015。
  5. Entirely Formatted my PC and Reinstalled It. 完全格式化我的电脑并重新安装它。

Some other Information: 其他一些信息:

  • I am running Windows Enterprise 10. 我正在运行Windows Enterprise 10。
  • I am running Visual Studio 2015 Enterprise. 我正在运行Visual Studio 2015 Enterprise。
  • It has worked once or twice but I am unable to identify any pattern as to when. 它已经工作了一两次,但我无法确定何时何种模式。
  • I am just trying to get a visual studio ASP.net 5 MVC out of the box template to run. 我只是想让一个视觉工作室ASP.net 5 MVC开箱即用的模板运行。
  • I've tried different BETA releases and also the RC release. 我尝试了不同的BETA版本以及RC版本。

So I've finally found the cause of the problem. 所以我终于找到了问题的原因。

I have BitDefender anti virus installed on the computer which for some strange reason it is causing this behavior. 我在计算机上安装了BitDefender反病毒,由于一些奇怪的原因它导致了这种行为。 As mentioned in the original post I did try disabling it but that didn't work. 正如在原始帖子中提到的,我尝试禁用它,但这不起作用。 I had to completely uninstall the software :( 我不得不完全卸载软件:(

Waste of time :( 浪费时间 :(

Start your application from the command prompt with dnx web or dnx-watch web, or select VS2015 todo so. 使用dnx web或dnx-watch web从命令提示符启动应用程序,或选择VS2015 todo。

Watch the console window for any errors. 观察控制台窗口是否有任何错误。

HTTP Error 502.3 - Bad Gateway

You will see these errors only on your screen if you use dnx web. 如果您使用dnx web,您将仅在屏幕上看到这些错误。

I also got this error. 我也遇到了这个错误。 and it was caused by a bug in EF. 它是由EF中的一个错误引起的。 You can get this error if IIS express can't communicate with kestrel anymore because kestrel stop responding. 如果IIS express不再与kestrel通信,您可能会收到此错误,因为红隼停止响应。

Be sure you select the correct dnx version by running dnvm use . 确保通过运行dnvm use选择正确的dnx版本。 to show the list of dnx version available use dnvm list 显示可用的dnx版本dnvm list使用dnvm list

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

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

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

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