Mod_Mono ASP.NET MVC 4部署问题

时间:2014-12-04 14:57:18

标签: asp.net-mvc mono mod-mono system.web.routing

我有一个ASP.NET MVC 4应用程序,我是在OS X上使用Xamarin Studio开发的。我正在部署到运行Ubuntu Server(最新版本)的Docker容器中,单声道3.2.8与mod_mono和apache一起安装。 / p>

我已成功将网站配置为在mono-server-4下运行,因为它是.NET 4.0网站。但是,我收到以下错误:

[System.TypeLoadException]: Could not load type 'System.Web.Routing.RouteCollection' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
      at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)
      at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in <filename unknown>:0
      at System.Reflection.MonoMethodInfo.GetDeclaringType (IntPtr handle) [0x00000] in <filename unknown>:0
      at System.Reflection.MonoMethod.get_DeclaringType () [0x00000] in <filename unknown>:0
      at System.Web.HttpApplicationFactory.GetApplicationTypeEvents (System.Type type) [0x00000] in <filename unknown>:0
      at System.Web.HttpApplicationFactory.GetApplicationTypeEvents (System.Web.HttpApplication app) [0x00000] in <filename unknown>:0
      at System.Web.HttpApplicationFactory.FireEvent (System.String method_name, System.Object target, System.Object[] args) [0x00000] in <filename unknown>:0
      at System.Web.HttpApplicationFactory.FireOnAppStart (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
      at System.Web.HttpApplicationFactory.GetApplication (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
      at System.Web.HttpRuntime.Process (System.Web.HttpWorkerRequest req) [0x00000] in <filename unknown>:0

我不确定为什么我会收到此错误,因为我已在目标服务器上安装了mono-complete,并且应用程序在本地正常运行。任何帮助很多赞赏!

编辑:在几次请求(4或5)之后,我似乎从同一个URL获得了404。不确定这是否相关......

2 个答案:

答案 0 :(得分:0)

我终于解决了这个问题。在apache配置文件中设置MonoServerPath指令时,我似乎不小心拼错了应用程序的名称。

答案 1 :(得分:0)

我遇到了同样的问题,尝试使用XSP2在mono上运行MVC应用程序。我的解决方案是安装mono-xsp4并使用xsp4运行它。