I have ASP.NET with MVC and Razor markup website and I want to run it on my Linux VPS.
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
)
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
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.
A suggested workaround until the bug is fixed and the method implemented is to use
Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule
instead ofHttpApplication.RegisterModule
.The issue here describes a workaround, which would be to change
HttpApplication.RegisterModule
toMicrosoft.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 .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.