Mono 3.0, Ubuntu 12.10, Nginx and ServiceStack

喜欢而已 提交于 2020-01-03 18:33:20

问题


According to the ServiceStack website, it should be easy to get ServiceStack up and running on Linux with Mono. I have installed nginx, mono 3.0 and fastcgi on the system (Ubuntu 12.10). I have used this tutorial to get Nginx and fastcgi running. In MonoDevelop I have right clicked on the project, then Tools -> Deploy to web. This generates the files I want to deploy. Then I have copied the dlls to /var/www/project_folder on Ubuntu. Next I started Nginx and fastcgi. My web.config file looks like this:

<?xml version="1.0"?>
<configuration>
   <system.web>
      <customErrors mode="Off"/>
      <httpHandlers>
         <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
      </httpHandlers>
      <compilation>
         <assemblies>
            <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
         </assemblies>
      </compilation>
   </system.web>
   <!-- Required for IIS 7.0 (and above?) -->
   <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>
    </system.webServer>
</configuration>

I have not added XSP to the server. When I go to the webpage on the server (remote address) I get an error telling me that it can't find ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory. The web.config file is located in the same folder as the dll containing this ServiceStackHttpHandlerFactory.

Any ideas what's causing this?


回答1:


Firstly, if you haven't read them yet, you should go through the wiki docs on getting ServiceStack running on Mono/Linux.

What ServiceStack.dlls have you copied and where did you get them from? The ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory is the ASP.NET entry point and it's available in the core ServiceStack.dll binary.

If it can't find the entry point ServiceStack.dll then there must be a problem in the Mono FastCGI/ASP.NET Host finding the ServiceStack .dlls, in an ASP.NET application it should be in the /bin folder relative to where your Web.Config is. If all the files are in the right place than it might be a file permission problem.



来源:https://stackoverflow.com/questions/14588788/mono-3-0-ubuntu-12-10-nginx-and-servicestack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!