2015-10-21 53 views
8

我试图发布我的MVC 6 Beta 8应用程序。我能够成功发布到Azure,但是当我尝试将它发布到ASPHostPortal时,我得到了500错误。在IIS上运行MVC 6 Beta 8应用程序

所以我试图发布应用程序到本地IIS,也失败了。首先,我发现我需要安装HttpPlatformHandler(否则IIS无法加载web.config)。但即使在那之后,我得到了502.3的错误。

HTTP Error 502.3 - Bad Gateway 
There was a connection error while trying to route the request. 

enter image description here

此外,在事件日志中我可以看到从HttpPlatformHandler错误1000不带任何说明。但它说“进程'0'未能启动。端口= 13679,错误代码='-2147024894'。”

stdout.log已创建,但为空。

这里是我的web.config:

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

    <httpErrors errorMode="Detailed" /> 
    <asp scriptErrorSentToBrowser="true" /> 
    </system.webServer> 

    <system.web> 
    <customErrors mode="Off" /> 
    <compilation debug="true" /> 
    </system.web> 
</configuration> 

我在哪里何去何从?

+0

http://docs.asp.net/en/1.0.0-beta8/publishing/iis.html –

+0

关闭当然,我做了所有这些,但有这个错误。本文仍提到WebListener,它不再存在于MVC6 Beta 8中。文章未更新到Beta 8。 –

+0

在[问题和问题](https://github.com/)中有与Azure/IIS相关的注释aspnet/Hosting/issues/364)关于beta8更新。他们可能会帮助 –

回答

5

感谢Daniel的评论和https://github.com/aspnet/Hosting/issues/364我想通过Web Platform Installer安装的HttpPlatformHandler 1.0不支持相对路径。所以我安装了HttpPlatformHandler 1.2,现在它工作了!

的替代解决方案(也为我工作)是使用在httpPlatform配置,而不是相对路径的完整路径。

+0

你碰巧知道,如果你能指出iis到你的vs.net解决方案wwwroot而不发布您进行更改等,并在浏览器中查看它们。我一直在环顾四周,每个人都一直在说明你需要发布这个项目。总是需要发布吗?我习惯于让IIS指向我的vs.net解决方案并用它进行调试。 – DotnetShadow

+0

从来没有尝试过自己(为什么如果你可以使用IISExpress或DNX网络),但理论上它可能工作,如果你试图通过更改路径“假”发布web.config –

+0

感谢您的答复。我问的唯一原因是我以前使用IIS进行开发,并想看看我是否仍然可以。你如何伪造发布? – DotnetShadow

相关问题