Link to home
Start Free TrialLog in
Avatar of mrbryanejones
mrbryanejones

asked on

ASP.NET HTTPhandler "Could not load type"


I am trying to write my first HTTPhandler with no joy. I want to catch all .ics requests. Using the code below I get the error "Could not load type iCalendarHTTPhandler from assembly website2". Website2 is the root class name of the project I am working on. The .ics files have been correctly added to the Application configuration for the website.


From the web.config
       <httpHandlers>
         <add verb="*" path="*.ics" type="iCalendarHTTPhandler, website2" />
      </httpHandlers>


The relevant class
Public Class iCalendarHTTPhandler
    Implements IHttpHandler

    Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
        Get
            Return (False)
        End Get
    End Property

    Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
        context.Response.Write(Date.Now.ToString & " Hello" & vbCrLf)
        context.Response.Write("All done")
    End Sub
End Class


Look forward to hearing from you.
Regards,
Bryan Jones
ASKER CERTIFIED SOLUTION
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrbryanejones
mrbryanejones

ASKER


What an idiot - after writing everything out and posting it I realised what I had done.

website2 is the name of my website dll, where as xyzclient was the name of my base class so the web.config should of read

       <httpHandlers>
         <add verb="*" path="*.ics" type="xyzclient.iCalendarHTTPhandler, website2" />
      </httpHandlers>


Easy when you know how!

Please see my post I placed one minute after yours. You were bang on the money.

Thanks for replying so quickly. I have literally wasted hours trying to sort this out!
HttpHandlers are real pain the first time ;)

--Nauman.