Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add an HttpHandler to the web.config?

I wrote a httphandler to handle all XSLT requests.

The name of the handler is XSLTHandler.cs.

web.config

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  <httpHandlers>
    <add verb="*" path="*.xsl" type="XSLTHandler" />
  </httpHandlers>
  </system.web>
</configuration>

I got this error message, dont know how to fix it.

Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load type 'XSLTHandler'.

like image 793
qinking126 Avatar asked Oct 23 '11 23:10

qinking126


1 Answers

What you're missing is the assembly and namespace that XSLTHandler belongs in, from MSDN. So if it's located in your current project, it should look like this:

<configuration>
  <system.web>
    <httpHandlers>
      <add verb="*" path="*.xsl" 
        type="WebApplicationName.XSLTHandler, WebApplicationName" />
    </httpHandlers>
  </system.web>
</configuration>
like image 68
George Stocker Avatar answered Sep 20 '22 12:09

George Stocker