Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7050169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:06:38+00:00 2026-05-28T03:06:38+00:00

I’d like to use XSP or better mod_mono within a .Net-Project using the IHttpHandler

  • 0

I’d like to use XSP or better mod_mono within a .Net-Project using the IHttpHandler method.

I have the following class (quite simple:

public class Class1 : IHttpHandler
{
    public bool IsReusable
    {
        get { return false; }
    }

    public void ProcessRequest(HttpContext context)
    {
        var result = "<h1>Yeah</h1>";
        var bytes = Encoding.UTF8.GetBytes(result);

        context.Response.Write(result);
    }
}

And the following web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers accessPolicy="Read, Execute, Script">
            <add name="Class" path="*" verb="*" type="IISHost.Class1" resourceType="Unspecified" preCondition="integratedMode" />
        </handlers>
    </system.webServer>
    <system.web>
        <compilation defaultLanguage="c#" />
    </system.web>
</configuration>

It is working perfectly within IIS. http://127.0.0.1/test/kfdlsa returns ‘Yeah’

Within XSP or mod_mono on Apache, I can create an index.aspx which is parsed and executed perfectly according to .Net-Framework, but it seems to be that the handler is not included within the mod_mono-Framework.

Is using IHttpHandler really implemented within Mono or shall I use another approach for collection all Requests to a certain Host and/or virtual directory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:06:39+00:00Added an answer on May 28, 2026 at 3:06 am

    HTTP handlers and modules work fine in Mono.

    Your problem is that your Web.config file use the syntax specific to the “Integrated Pipeline” mode of IIS. This mode doesn’t exist under Apache/mod_mono. So you must use the old syntax (i.e. the one for the “Classic Pipeline” mode) and provide a <system.web/httpHandlers> section, in addition to the existing <system.webServer/handlers> section.

    See this Web.config example :

    <?xml version="1.0"?>
    <configuration>
        <system.web>
            <httpHandlers>
                <add path="*.rss" verb="*" type="CedricBelin.Web.FeedHandler" />
            </httpHandlers>
        </system.web>
    
        <system.webServer>
            <handlers>
                <add name="Feed" path="*.rss" verb="*" type="CedricBelin.Web.FeedHandler" />
            </handlers>
    
            <validation validateIntegratedModeConfiguration="false" />
        </system.webServer>
    </configuration>
    

    The <validation ...> tag is very important: if you forget it, IIS throws an error and complains that an unauthorized section is used in the Integrated Pipeline context.

    The next step is to instruct the Apache server to transfer the handling of your files to mod_mono, like this :

    <VirtualHost *:80>
        ServerName mono.localhost
        DocumentRoot "/Library/WebServer/Documents/MonoTest"
        AddType application/x-asp-net .rss
    </VirtualHost>
    

    The line AddType application/x-asp-net .rss is the important one. See the relation between path="*.rss" in Web.config and .rss extension in this line.
    If you want to handle all extensions, as in your example (path="*"), you must replace the line AddType application/x-asp-net .rss by ForceType application/x-asp-net.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.