2

致力于获取一个 ServiceStack.NET HelloWorld 示例并继续使用 Mono。卡在这个错误:

System.Web.HttpException
Failed to load httpHandler type `ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack'

Description: HTTP 500.Error processing request.

Details: Error processing request.
Exception stack trace:
at System.Web.Configuration.HttpHandlerAction.LoadType (System.String type_name) [0x00053] in /root/mono-2.11.4/mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerAction.cs:170 at System.Web.Configuration.HttpHandlerAction.GetHandlerInstance () [0x00039] in /root/mono-2.11.4/mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerAction.cs:296 at System.Web.Configuration.HttpHandlersSection.LocateHandler (System.String verb, System.String filepath, System.Boolean& allowCache) [0x0004b] in /root/mono-2.11.4/mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlersSection.cs:80 at System.Web.HttpApplication.LocateHandler (System.Web.HttpRequest req, System.String verb, System.String url) [0x0003b] in /root/mono-2.11.4/mcs/class/System.Web/System.Web/HttpApplication.cs:1603 at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00028] in /root/mono-2.11.4/mcs/class/System.Web/System.Web/HttpApplication.cs:1627 at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in /root/mono-2.11.4/mcs/class/System.Web/System.Web/HttpApplication.cs:1614 at System.Web.HttpApplication+<Pipeline>c__Iterator3.MoveNext () [0x00866] in /root/mono-2.11.4/mcs/class/System.Web/System.Web/HttpApplication.cs:1276 

这是我的 web.config - 我认为它一定有问题:

<?xml version="1.0"?>
<configuration>
  <!-- ServiceStack: Required to host at: /servicestack -->
  <location path="servicestack">
    <system.web>
      <httpHandlers>
        <add path="servicestack*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
      </httpHandlers>
    </system.web>

    <!-- Required for IIS7 -->
    <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
      <validation validateIntegratedModeConfiguration="false" />
      <handlers>
        <add path="servicestack*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
      </handlers>
    </system.webServer>
  </location>
  <!-- Required for MONO -->
  <system.web>
  <customErrors mode="Off"/>
    <httpHandlers>
      <add path="servicestack*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
    </httpHandlers>
  </system.web>
  <!-- Required for IIS7 -->
  <system.webServer>
    <!-- ServiceStack: Required -->
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>
</configuration>
4

1 回答 1

4

我的应用程序的 Apache 虚拟主机设置中的配置错误。在 Apache 配置文件的 MonoApplications 指令中未正确指定应用程序路径。更正错误解决了问题。

于 2013-05-14T04:55:11.787 回答