locked
App_Code HttpHandler causes Could not load file or assembly RRS feed

  • Question

  • User-881099725 posted

    Hi,

         I am using Visual Web Express 2005 and in my App_Code I have the database access code (DAL). I just added an HttpHandler as follows:

     

    • The Handler's class name PingBackHandler in namespace Coralys.Web.Handlers and located in the App_Code directory
    • The database code related to the site is also contained in App_Code. The PingBackHandler makes use of some of those classes
    • Added an httpHandler entry in the httpHandlers section of system.web in web.config. This entry looks like this  
      <httpHandlers>
      <add verb="*" path="PingBack.aspx" type="Coralys.Web.Handlers.PingBack.PingBackHandler, Coralys.Web.Handlers.PingBack"/>
      </httpHandlers>
    • The whole thing compiles fine, no errors and no warnings.
    Now, when I try to access any page I get "Could not load file or assembly Coralys.Web.Handlers.PingBack or one of its dependencies. I have checked the namespaces and class name and all is ok but the error still persists. Is it then not possible to have an HttpHandler when using the App_Code directory? Moving that to a class library would mean moving a lot of the database stuff and I really don't have time for that right now.

     

    Thursday, July 26, 2007 12:09 PM

Answers

  • User-1427546256 posted

    When you use the syntax you've specified for type, it means look for the "Coralys.Web.Handlers.PingBack.PingBackHandler", in a DLL with the namespace "Coralys.Web.Handlers.PingBack".  Since it's not in a DLL assembly, and it's in App_Code, just make it:

    <httpHandlers>
    <add verb="*" path="PingBack.aspx" type="Coralys.Web.Handlers.PingBack.PingBackHandler"/>
    </httpHandlers><XMP></XMP>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 26, 2007 4:26 PM