IHttpHandler メソッドを使用して、.Net-Project 内で XSP またはより良い mod_mono を使用したいと思います。
私は次のクラスを持っています(非常に単純です:
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);
}
}
そして、次の 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>
IIS内で完全に機能しています。http://127.0.0.1/test/kfdlsaは「はい」を返します
Apache の XSP または mod_mono 内で、.Net-Framework に従って完全に解析および実行される index.aspx を作成できますが、ハンドラーが mod_mono-Framework 内に含まれていないようです。
Mono 内に実際に実装された IHttpHandler を使用しているか、特定のホストおよび/または仮想ディレクトリへのすべての要求を収集するために別のアプローチを使用する必要があります。