locked
iis 7 + http custom handler error: could not load file or assembly The system cannot find the file specified RRS feed

  • Question

  • User-886767426 posted
    Windows vista 32 bit - C# - .NET 4 - sqlite - IIS 7

    I'm building a small project that contains is a custom HTTP handler where an user can request a XML file and the project will generate the file and send it to the user. It should be flexible enough to send something else too like e.g. json.

    Everything was going well until I had to deploy the handler. I've created a library (dll) file which contains the logic for serving of the requested information. I've open IIS manager and I've created a virtual directory to the debug bin file (later on i made it an application. it did not make a difference).

    I've followed countless examples and tutorials like these ones:

    I started with this one: http://support.microsoft.com/kb/308001

    http://msdn.microsoft.com/en-us/library/bb515343.aspx

    msdn.microsoft.com/en-us/library/46c5ddfy.aspx

    But with no luck. As you could have read I'm not using any asp.net website even though I do have a web.config that I've added to the bin folder and it looks like this:

       
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>  
    <system.webServer>    
    <httpErrors errorMode="Detailed" />   
     <asp scriptErrorSentToBrowser="true" />    <directoryBrowse enabled="false" />    
    <handlers accessPolicy="Read, Script, Execute">      
    <add name="LigoManagedHandler" path="*" verb="*" type="Ligo.Service, Ligo" resourceType="Unspecified" preCondition="integratedMode" />    
    </handlers>  </system.webServer></configuration>




    When I try to run handler in the browser get the following error:

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


    Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Ligo' or one of its dependencies. The system cannot find the file specified.
    I have tried so many possible combination in IIS manager to get it working ('httphandlers', 'classic mode' and so on ...) but i'm truly stuck. The information I've found on the internet is not helping much.

    What am I doing wrong or missing to make it work?
    Thursday, May 10, 2012 11:34 PM

Answers

  • User-886767426 posted

    I figure it out. I had to make a asp.net website project and add my dll as reference to this project.

    I read this thread that provided this information which is not clear on the internet. 

    http://forums.asp.net/t/1088861.aspx/1?What+causes+the+quot+Could+not+load+type+quot+problem+

    It should state that it is not possible to make the httphandler without a aspnet website project. or am i mistaken? the example on the internet are incorrect! or provide too little information.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 13, 2012 1:13 AM