HTTP 错误 502.5 - 将 ASP.NET Core 1.1 复制到另一台机器后进程失败

HTTP Error 502.5 - Process Failure after copying ASP.NET Core 1.1 to another machine

我按照官方 ASP.NET 网站上的程序将我的 ASP.NET 核心应用程序从 1.0 升级到 1.1。该应用程序在 Windows 10(从 win 7 升级)的原始位置上运行良好。但是当我在另一台也安装了最新的 VS2015-Update3 并安装了 NET Core 1.0.1 tools Preview 2 的机器 (Win 7) 上复制该应用程序时,该应用程序编译正常但出现以下错误:HTTP Error 502.5 - Process Failure

此外,事件日志显示如下

Failed to start process with commandline '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectSystem\VSIISExeLauncher.exe" -p "C:\Program Files\dotnet\dotnet.exe" -a "C:\DotNET2015\ABCTest\src\ABCTest\bin\Debug\netcoreapp1.1\ABCTest.dll" -wd "C:\DotNET2015\ABCTest\src\ABCTest" -wbe Global\Build500340c7-6e16-4a08-b314-ff5fd51b1dcb -lse Global\Launchb628508b-6e25-455f-9afa-6092434506ed', ErrorCode = '0x80004005'.

注意 应用在默认 IISEXPRESS

上 运行

project.json:

{
  "userSecretsId": "aspnet-ABCTest-6af8ade3-87ff-4468-a9ce-8bb69c696ab8",

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.AspNetCore.Mvc.Core": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Identity": "1.1.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final",
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-preview4-final"  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238"
  },

  "frameworks": {
    "netcoreapp1.1": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "Areas/**/Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

我在 Visual Studio 中更新 NuGet 包时遇到了同样的问题。 就我而言,解决方案是降级软件包: Microsoft.AspNetCore.Server.Kestrel 从 1.1.0 到 1.0.1 Microsoft.NETCore.App 从 1.1.0 到 1.0.1

..然后一切又恢复正常了。

您需要在将应用程序复制到的计算机上安装 .NET Core 1.1 运行时。你安装的是1.0.1.