指定的 CGI 应用程序遇到错误,服务器终止了进程。将 mvc6 发布到云端后出错

The specified CGI application encountered an error and the server terminated the process. error after publishing mvc6 to cloud

我刚刚使用 visual studio 2015 "web application- No Authentication" templete 项目创建了一个新的 ASP5 MVC6 项目。我没有对项目做任何更改,我在本地发布了项目,并使用 Filezilla 将发布的文件上传到主机 (gearhost.com)。但是当我打开我的网站时,它给了我这个错误: 指定的 CGI 应用程序遇到错误,服务器终止了进程。

我的网站地址: http://publish1.gear.host/

这是 web.config 包含的内容:

<configuration>
  <system.webServer>
    <handlers>
      <add name="httpplatformhandler" path="*" verb="*"     modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
  </system.webServer>
</configuration>

这是 launchSettings.json 包含的内容:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:26153/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "Hosting:Environment": "Development"
      }
    },
    "web": {
      "commandName": "web",
      "environmentVariables": {
        "Hosting:Environment": "Development"
      }
    }
  }
}

这是 global.json 包含的内容:

{
  "projects": [
    "src"
  ],
  "sdk": {
    "version": "1.0.0-rc1-final"
  },
  "packages": "packages"
}

这是 appsettings.json 包含的内容:

{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Verbose",
      "System": "Information",
      "Microsoft": "Information"
    }
  }
}

谢谢..

几个注意事项:

  1. 您的主机需要安装 httpPlaformHandler 模块才能运行。
  2. 您知道您的主机是否支持 ASP.NET 核心吗?
  3. 错误似乎表明处理程序无法正确处理请求。您可以在 web.config 中执行 stdoutLogEnabled ="true" 并在日志文件中查看失败的实际原因。可能是因为权限问题,EF 无法与数据库服务器通信,可能是找不到 DNX 进程路径。

我们还不支持 .NET 5 或 MVC 6,因为它们尚未发布(仅 beta/rc)。但是,我们支持所有版本的 .NET 和 MVC。