Mono上的ServiceStack示例

时间:2013-05-13 08:52:12

标签: mono servicestack

致力于获取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>

1 个答案:

答案 0 :(得分:4)

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