locked
WebService and HttpHandler RRS feed

  • Question

  • User1289704068 posted

    Hi all,

    I have a web service project witch include HttpHandler class. In the we config I added the HttpHandler element required :

    <add verb="*" path="*.jpg" type="MyHttpHandler.ImHandler"/>

    All the time I get : couldn't load MyHttpHandler.ImHandler.

    I add the assembly name that exsists in the project bin directory :

    <add verb="*" path="*.jpg" type="MyHttpHandler.ImHandler,App_Code.dll"/>

    I got : Could not load file or assembly 'App_Code.dll' or one of its dependencies. The system cannot find the file specified.

    It seems like can not find this file somewhere related to this project.

    1. Where is the compiled code of the Handler class exsist, is in the web service App_Code.dll file or other ?

    2. i deploy this project to IIS 5 and I still get the same thing like the visual studio 2005 web server error. 

    3. What can be the problem?

    Please help...

     

    Monday, October 9, 2006 1:42 AM

Answers

  • User-1469150719 posted

    First, an assembly refers to a .dll file, but doesn't mean that you have .dll in the assembly name.

     So the assembly System.Web corresponds to the file System.Web.dll

    so if I wanted to reference a type within that dll in the config.. I'd write:

    type="System.Web.UI.SomeClass, System.Web"

    which means SomeClass from the namespace System.Web.UI from the assembly System.Web

    the 2nd issue is that I don't think your assembly is App_Code, I think it gets the same assembly as your web project.  I'd recommend doing away with the crappy App_Code folder and move to a real project structure. 

    Time to get away from that scary App_Code folder!

    Either download the SP1 preview of Vistual Studio 2005, or download Scott Guthrie's Web Application Project add-on.  Instead of saying File-> new Website... you'd create a new Project -> Web Application Project.

     Either that or place your webservice classes in another assembly and keep your web service project very thin.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 11, 2006 5:49 PM