asp.netlinuxapachemonoashx

Error using ASP.NET application with Mono


So, I asked a few days ago, how to deploy an ASP.NET application on an Apache web server, and in my case, using Mono was the better solution. (Can I deploy an .ashx file on Linux?)

Here is my app:
/wschb.ashx
<%@ WebHandler Language="C#" CodeBehind="wschb.ashx.cs" Class="MyAPP.wschb" %>
/bin/MyAPP.dll
I don't know what is in this file

What I want to do with it is simple: I send a POST request with an XML file to the wschb.ashx file and I get another XML file.

I installed mono, XSP4 and mod_mono.
I created a virtual host for my app.
I added this on my apache2.conf:
Include /etc/apache2/mods-available/mod_mono.conf
LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so

And now I want to call my wschb.ashx file, I get this error: System.OverflowException

Is my application not compatible with Mono, or did I configured something wrong?


Solution

  • If you want to run a asp.net site on Linux, then use .net core, and using MVC for the web site.

    Attempting to run a asp.net framework 4.x on Linux? Gee, I can't imagine you EVER get that to work well since such sites require IIS services. IIS has a Telephone book sized set of configuring and features such as app pool that are required to be setup for a working IIS site.

    Unless you running IIS here, and can configure IIS with all its settings? You really on a wild goose chase, and wasting time and efforts here. You need the full IIS services and ability to setup IIS. You not going to get a asp.net framwork site working with apache - you just not.

    Mono = abilty to run compiled .net code.

    Mono DOES NOT = abilty to run IIS web server, which has a BOATLOAD of windows dendances, and as noted has a BOATLOAD of setup.

    The fact that you can run .net 4.x framework code on Linux is a MASSIVE far cry from that of running a asp.net site that requires IIS to run.

    different systems of course require different web servers.

    you can't take a Apache web site, and by some act of magic make that site run with IIS web server. And the reverse is also true.

    Mono will get you compiled .net code to run, but a asp.net web site? that is a Mount Everest of a different issue, and you need IIS web server to run such asp.net sites.

    As I stated, if you build the asp.net web site using .net core, use MVC (not web forms), then you have a true platform neutral setup, and that setup can even use + run using Apache.

    you setup is not supported, and unless you have a full pop edition of IIS smoothly running on that server, this will not work. You can't use Apache for the .net framework sites. You most certainly can run + deploy with great ease if you build your site using .net core (not the older .net framework), and as noted you created a MVC site. So, if using .net standard (the new name for .net core), then no problem.

    However, .net framework? No, not really going to work well, if at all.