Re: [Mono-aspnet-list] Mono and IHttpHandler

2011-11-18 Thread Daniel J. Summers
On Thu, Nov 17, 2011 at 10:19 AM, mbrenn br...@depon.net wrote:

public void ProcessRequest(HttpContext context)
{
var result = 
 Yeah
 ;
var bytes = Encoding.UTF8.GetBytes(result);

context.Response.Write(result);
}


Shouldn't you be writing bytes instead of result?

-- 
*Daniel J. Summers*
*Owner, DJS Consulting*
E-mail daniel.summers.2...@gmail.com • Website http://djs-consulting.com
 • Support http://support.djs-consulting.com • Tech
Bloghttp://techblog.djs-consulting.com

GEEKCODE 3.12 GCS/IT d s-:+ a C++ P--- L++ E--- W++ N++ o? K- w !O M--
V PS+ PE++ Y? PGP- t+ 5? X+ R* tv b+ DI++ D+ G- e++ h r+++ y
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] Mono and IHttpHandler

2011-11-18 Thread Kornél Pál
Hi,

You should use Classic (non-Integrated) mode config (system.web rather 
than system.webServer). You can try it in IIS as well in Classic 
pipeline mode.

You also will have to either map all requests to mono or just Class in 
Apache configuration in order to make this work.

Kornel

mbrenn wrote:
 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 = 
 Yeah
 ;
  var bytes = Encoding.UTF8.GetBytes(result);

  context.Response.Write(result);
  }
  }

 This class gets compiled via .Net to IISHost.dll and is put within the
 'bin'-Directory of the webroot.

 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?

 --
 View this message in context: 
 http://mono.1490590.n4.nabble.com/Mono-and-IHttpHandler-tp4080761p4080761.html
 Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
 ___
 Mono-aspnet-list mailing list
 Mono-aspnet-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-aspnet-list

___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] Mono and IHttpHandler

2011-11-17 Thread Robert Jordan
On 17.11.2011 18:19, mbrenn wrote:
 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?

It's implemented, although its configuration is a bit different.

On ASP.NET's side you must add a handler:

system.web
   httpHandlers
 add verb=* path=*.foo type=IISHost.Class1/

On Apache+mod_mono's side you must add a new type:

AddType application/x-asp-net .foo

I don't know if something like * is supported. Maybe inside a
location where a SetHandler was activated. See mod_mono's docs.

Robert

___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list