HttpHandler 101 FAIL

Wenn ich ein HTTP-handler:

<add verb="*" path="*test.aspx" type="Handler"/>

Mit der Klasse:

using System;
using System.Web;

public class Handler : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        context.Response.Write("Hello World");
    }

    public bool IsReusable
    {
        get { return false; }
    }

}

Meine ASP.NET Anwendung stirbt mit der Fehlermeldung "Konnte nicht geladen werden Typ 'Handler'." wenn ich versuche, auf http://localhost:port/mysite/this-is-a-test.aspx.

Ich dachte, vielleicht war es ein namespace Problem, also versuchte ich das, was folgt, aber habe das gleiche "Konnte nicht geladen werden Typ 'Test.Handler'." - Fehler.

<add verb="*" path="*test.aspx" type="Test.Handler, Test"/>

Mit der Klasse:

using System;
using System.Web;

namespace Test
{

    public class Handler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Hello World");
        }

        public bool IsReusable
        {
            get { return false; }
        }

    }

}

Ich wusste, ich war immer rostig mit ASP.NET aber ich bin ohne Ahnung auf diese.

InformationsquelleAutor core | 2009-01-20
Schreibe einen Kommentar