我在Windows 8上使用Visual Studio 2013.我有一个基于ServiceStack构建的Web服务。一切都在我的机器上工作正常但是当它部署到AppHarbor时我得到500错误。我设置了customErrors mode="off"
,我仍然得到500错误,没有堆栈跟踪。
如果启用自定义错误不会产生堆栈跟踪,那么这表示阻止ASP.NET运行时初始化的配置问题。您可以通过将应用程序(本地构建或从AppHarbor下载的构建输出)部署到本地计算机上运行的完整IIS来调试此类问题。您必须将应用程序池配置为在Integrated Pipeline模式下运行,以正确复制AppHarbor的环境。
所以我这样做了。我从AppHarbor下载了构建输出并在我的本地IIS上运行它并且工作正常!
AppHarbor错误页面显示
无错误显示。
AppHarbor的日志会话功能没有显示任何有意义的信息:
2013-12-31T09:55:20.886 + 00:00 appharbor web.1创建新员工(版本1388526921) 2013-12-31T09:55:24.864 + 00:00 appharbor web.1热身(版本1388526921) 2013-12-31T09:55:32.134 + 00:00 appharbor web.1 Web worker root URL返回HTTP状态码500(内部服务器错误)(版本1388526921)
有什么建议吗?
- 对于引用,这是我的web.config概述:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth">
<section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
<section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
<section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
<section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
</sectionGroup>
</configSections>
<appSettings>
....
</appSettings>
<connectionStrings>
....
</connectionStrings>
<system.web>
<customErrors mode="Off">
</customErrors>
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
</httpHandlers>
<compilation debug="true" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
</handlers>
<directoryBrowse enabled="true" />
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MongoDB.Driver" publicKeyToken="f686731cfb9cc103" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.2.34" newVersion="1.8.2.34" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MongoDB.Bson" publicKeyToken="f686731cfb9cc103" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.2.34" newVersion="1.8.2.34" />
</dependentAssembly>
</assemblyBinding>
<!-- This prevents the Windows Event Log from frequently logging that HMAC1 is being used (when the other party needs it). -->
<legacyHMACWarning enabled="0" />
</runtime>
<uri>
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
which is necessary for OpenID urls with unicode characters in the domain/host name.
It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
<idn enabled="All" />
<iriParsing enabled="true" />
</uri>
<system.net>
<defaultProxy enabled="true" />
<settings>
</settings>
</system.net>
<dotNetOpenAuth>
<!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. -->
<!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-options/ -->
<openid>
<relyingParty>
<security requireSsl="false">
</security>
<behaviors>
<!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
with OPs that use Attribute Exchange (in various formats). -->
<add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
</behaviors>
</relyingParty>
</openid>
<messaging>
<untrustedWebRequest>
<whitelistHosts>
</whitelistHosts>
</untrustedWebRequest>
</messaging>
<!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
<reporting enabled="true" />
</dotNetOpenAuth>
</configuration>
答案 0 :(得分:0)
只是一个疯狂的猜测:(没有多少继续)但我有类似的问题,例如,我在我的本地机器上使用IIS重写模块(它工作正常),但当我上传到没有安装附加模块的主机,我会得到一个500错误,很少继续 - 听起来很相似。它让我疯狂地试图找到它。
因此,请确保您在IIS中本地使用的所有选项/插件也安装在主机上。
同样,请确保您了解web.config中引用/使用的所有内容 - 这可能是问题所在。