我有一个 ASP.NET MVC 4 应用程序,它是我在 OS X 上使用 Xamarin Studio 开发的。我正在部署到一个运行 Ubuntu Server(最新版本)的 Docker 容器中,其中安装了 mono 3.2.8 以及 mod_mono 和 apache。
我已成功将网站配置为在 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。不确定这是否相关......