Cannot launch asp.net core web app in IIS Express

2019-04-04 04:34发布

[Edit] The problem is BitDefender anti virus. 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. 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. I checked my event log and noticed the following two entries:

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

and also:

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'.

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.

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!! :) 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.

How do I get it to run using the default settings? or am I missing something here?

Here is my project.json file

{
  "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.
  2. Cleared the Visual Studio cache.
  3. Repaired Visual Studio 2015.
  4. Uninstalled and then Reinstalled Visual Studio 2015.
  5. Entirely Formatted my PC and Reinstalled It.

Some other Information:

  • I am running Windows Enterprise 10.
  • I am running 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.
  • I've tried different BETA releases and also the RC release.

2条回答
我只想做你的唯一
2楼-- · 2019-04-04 04:52

Start your application from the command prompt with dnx web or dnx-watch web, or select VS2015 todo so.

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.

I also got this error. and it was caused by a bug in EF. You can get this error if IIS express can't communicate with kestrel anymore because kestrel stop responding.

Be sure you select the correct dnx version by running dnvm use. to show the list of dnx version available use 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
查看更多
放荡不羁爱自由
3楼-- · 2019-04-04 05:14

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. 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 :(

查看更多
登录 后发表回答