IHttpHandlerメソッドを使用して.Net-Project内でXSP以上のmod_monoを使用したいと思います。MonoとIHttpHandler
私は次のクラス(非常に簡単持っている:それはIISの中に完全に取り組んでいる
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>
をhttp://127.0.0.1/test/kfdlsaリターン 'うん'
以内XSPやmod_monoをApache上で実行すると、.Net-Frameworkに従って完全に解析され、実行されるindex.aspxを作成できますが、ハンドラはそうではないようですmod_mono-Frameworkに含まれています。
IHttpHandlerは実際にMono内で実装されていますか、または特定のホストおよび/または仮想ディレクトリへのすべての要求を収集する別の方法を使用する必要があります。
セドリック、あなたの有益な答えに感謝します。私は静的変数の生涯に関係する質問をホスティングしている同様のモノラルウェブを持っています。私はあなたの入力が大好きです。http://stackoverflow.com/questions/13480328/c-sharp-mono-linux-web-server-hosting-with-consistent -static-variables-across – Glenn
完全に動作します!ありがとうございました。私はスタンドアロン(mod_monoではなく)モードでXSPを使用しています。そのため、このシナリオではApacheの設定は必要ありませんが、web.configの変更は必要なものです。 –
Mono.WebServerのweb.configでサポートされている情報はどのように取得されますか? – DonDon