Error loading Http handler

I successfully added and configured HttpHandler in Asp.Net WebApplication , but ran into problems when trying to add the same HttpHandler to Asp.Net WebSite . I registered it in the web.config file, something is missing for me

This is the error I get

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 'MyHandler'. Line 98: </pages> Line 99: <httpHandlers> Line 100: <add verb="*" path="*.result" type="MyHandler"/> Line 101: <remove verb="*" path="*.asmx"/> 

Here is the handler

 public class MyHandler: IHttpHandler { #region IHttpHandler Members public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { } #endregion } 

NOTE. I did not make any requests for the handler at the URL, it just does not allow me to run the application.

thanks

+4
source share
2 answers

Edit: First I skipped the website:

Put .cs in App_code and use this:

 <add verb="*" path="*.result" type="MyHandler, App_Code"/> 
+4
source

Try using the fully qualified type name in the type attribute, including the assembly name. Like this:

 <add verb="*" path="*.result" type="Namespace.MyHandler,AssemblyName" /> 
+4
source

Source: https://habr.com/ru/post/1299827/


All Articles