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

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

提问人:Sepidehye Fanavari 提问时间:2/29/2016 更新时间:3/3/2016 访问量:1567

问:

我刚刚使用 Visual Studio 2015“Web 应用程序 - 无身份验证”模板项目创建了一个新的 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"
    }
  }
}

谢谢。。

发布 ASP.NET-CORE-MVC

评论

0赞 blowdart 2/29/2016
主机是否安装了 IISPlatformHandler?是v1.2吗?他们安装了正确的版本吗?(32 V 64 位)。基本上,这看起来像是主机问题,而不是您可以解决的问题。要求主机查看 IIS 平台处理程序日志,并完成 github.com/aspnet/Home/issues/1000 顺便说一句,不要将“开发”设置为实时服务器上的托管环境。

答:

0赞 Muqeet Khan 2/29/2016 #1

几个注意事项:

  1. 您的主机需要安装 httpPlaformHandler 模块才能正常工作。
  2. 您知道您的主机是否支持 ASP.NET Core 吗?
  3. 错误似乎表明处理程序无法正确处理请求。您可以在 web.config 中执行此操作,并在日志文件中查看失败的实际原因。可能是因为权限的原因,EF无法与DB服务器通信,可能是DNX进程路径找不到。stdoutLogEnabled ="true"
0赞 Ryan Kekos 3/3/2016 #2

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