【问题标题】:FormsAuthentication of ASP.NET app running on Mono在 Mono 上运行的 ASP.NET 应用程序的 FormsAuthentication
【发布时间】:2015-07-25 02:43:16
【问题描述】:

我有一个 ASP.NET MVC4 Web 应用程序,它是在 Windows 中使用 Visual Studio 开发的。我正在尝试将它部署到在 Ubuntu 上运行的 Apache 服务器。 我打算暂时让它在 xsp 上运行,因为这似乎更容易开始。

一长串错误中最新的是这样的:

Missing method System.Web.Security.FormsAuthentication::get_IsEnabled()
in assembly /usr/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll, 
referenced in assembly /tmp/username-temp-aspnet-0/e475125c/assembly/shadow/5cf10065/81ba6702_dd4b6767_00000001/System.Web.Http.WebHost.dll

我已经从 web.config 文件中删除了 ... 标记,所以我不确定为什么有任何东西试图调用 FormsAuthentication。错误似乎来自单声道 .dll。

是什么导致了这个错误,我需要做什么来修复它?

【问题讨论】:

    标签: apache asp.net-mvc-4 ubuntu mono xsp


    【解决方案1】:

    这 - 以及许多相关的错误消息 - 是因为我同时安装了 Mono 2 和 Mono 4,而 Mono 2 不支持 MVC4,但由于某种原因是默认设置。我删除并重新安装了 Mono,这解决了这个特殊问题。

    Could not load type 'System.Web.Http.WebHost.HttpControllerHandler' from assembly 'System.Web.Http.WebHost'
    Could not load type 'System.Web.Http.AcceptVerbsAttribute' from assembly 'System.Web.Http'
    Could not load type 'System.Web.Http.Controllers.HttpActionContext' from assembly 'System.Web.Http'     
    Could not load type 'System.Web.Http.HttpOptionsAttribute' from assembly 'System.Web.Http' 
    Could not load type 'System.Web.Http.HttpHeadAttribute' from assembly 'System.Web.Http'
    Could not load type 'System.Web.Http.HttpPatchAttribute' from assembly 'System.Web.Http'
    

    更新:

    如果您的 web.config 中指定的 MVC(或 System.Web.whatever)版本与您正在使用的 dll 不匹配,您也会遇到此问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-12
      • 2010-10-18
      • 1970-01-01
      相关资源
      最近更新 更多