在 Linux 上使用 xsp 运行 ASP.NET 应用程序时缺少方法错误

Missing method errors when running ASP.NET app with xsp on linux(在 Linux 上使用 xsp 运行 ASP.NET 应用程序时缺少方法错误)
本文介绍了在 Linux 上使用 xsp 运行 ASP.NET 应用程序时缺少方法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带有 MVC 和 Razor 标记网站的 ASP.NET,我想在我的 Linux VPS 上运行它.

I have ASP.NET with MVC and Razor markup website and I want to run it on my Linux VPS.

我有 mono 3.2.8 和 xsp4 3.0.0.0 版本,都来自 Ubuntu 存储库(使用 apt-get install mono-complete mono-xsp4 安装)

I have mono 3.2.8 and xsp4 3.0.0.0 version, both from Ubuntu repository (installed using apt-get install mono-complete mono-xsp4)

当我将网站上传到服务器并在网站文件夹中运行 xsp4 时,它会启动并打印出它正在侦听端口 8080.但是,当我使用网络浏览器导航到我的网站时,它会显示运行时错误和 xsp4 输出这是为了安慰

When I upload my website to server and run xsp4 in the website's folder, it start and prints out that it's listening on port 8080. However when I use my web browser to navigate to my website, it displays runtime error and xsp4 outputs this to console

Missing method System.Web.HttpApplication::RegisterModule(Type) in assembly
/usr/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll, referenced 
in assembly /tmp/root-temp-aspnet-0/55726984/
assembly/shadow/df4b0596/52105b83_8d5b5e15_00000001/Microsoft.Owin.Host.SystemWeb.dll

Missing method RegisterAllAreas in assembly /tmp/root-temp-aspnet-
0/55726984/assembly/shadow/dc5a60b8/51013ead_8d5b5e15_00000001/<website_name>.dll, type
System.Web.Mvc.AreaRegistration

这是一个全新的 Ubuntu 14.04 安装.我正在使用 Visual Studio 2013 在 Windows 上开发我的网站.知道如何修复这些错误吗?

It's a fresh Ubuntu 14.04 installation. I'm developing my website on Windows, using Visual Studio 2013. Any idea how to fix these errors?

推荐答案

有关此问题的上游错误报告位于 这里.

The upstream bug report regarding this issue is located here.

在修复错误之前建议的解决方法是使用 Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule 而不是 HttpApplication.RegisterModule.

A suggested workaround until the bug is fixed and the method implemented is to use Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule instead of HttpApplication.RegisterModule.

这里的问题描述一种解决方法,将 HttpApplication.RegisterModule 更改为 Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule.com/SourceControl/latest#src/Microsoft.Owin.Host.SystemWeb/PreApplicationStart.cs" rel="nofollow">PreApplicationStart.cs in OWIN(之前的master已经有NET 4.0的相关IFDEF,但是由于某种原因已恢复)或包含他们指定的 DLL 或在 web.config 中手动注册模块.

The issue here describes a workaround, which would be to change HttpApplication.RegisterModule to Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule in PreApplicationStart.cs in OWIN (the previous master already had the relevant IFDEF for NET 4.0, but it was reverted for some reason) or to include the DLL they specify or register the module manually in the web.config .

不需要对 OWIN 进行任何代码更改的替代方法是在 Mono 中实现缺失的方法并修复错误,然后将修复反向移植到您的 Mono 版本.

The alternative that doesn't require any code change to OWIN is to implement the missing method in Mono and fix the bug and then backport the fix to your Mono version.

这篇关于在 Linux 上使用 xsp 运行 ASP.NET 应用程序时缺少方法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
How to minify in .net core mvc view?(如何在.Net核心MVC视图中缩小?)