locked
Error on compiling HTTPHandler project RRS feed

  • Question

  • User955745633 posted

    Hi All, 

     I am trying to create a simple HTTP handler in ASP.net 2.0. I am using VS
     2005. I am trying to handle a custom extension file givein in the URL.  I
     have also created the following entry in the web.config file

          <httpHandlers
            <add verb="*" path="*.imgw" type="Customhandler.Handler,Handler" /
         </httpHandlers

     following is the code in Handler.ashx file

     <%@ WebHandler Language="C#" Class="Customhandler.Handler" %

     using System;
     using System.Web;
     namespace Customhandler
     {
         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;
                 }
             }

         }

     }

     During compliation there is no error..but when I run the code, I get the
     following error

     Could not load file or assembly 'Handler' or one of its dependencies. The
     system cannot find the file specified

     the following line from the web.confg file is highlighted in RED

       <add verb="*" path="*.imgw" type="Customhandler.Handler,Handler" />

     I can understand that it is looking for handler.dll file. But I do not see
     any DLL file beign createdin VS 2005. I am a little new to VS 2005. Does
     anyone know how to resolve this problem

     many thanks :)
     pradeep_tp

    Wednesday, February 28, 2007 3:28 AM

Answers

  • User113421904 posted

    The last Handler in your configuration should be assembly name.  

          <httpHandlers
            <add verb="*" path="*.imgw" type="Customhandler.Handler,Handler" /
         </httpHandlers

    By default it is built into the same assembly of the project, so you can try web project name instead, please check the actual output in the bin folder.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 6, 2007 7:31 AM