Register handler for asmx in class library

Salvatore Rizzo 21 Reputation points
2023-02-23T14:55:31.8633333+00:00

I created in my classlibrary a handler class with webservice interface.

Now I would like to always register it in the classlibrary (not in the web.config)
so that I can call it according to a specific url.
For example: /mywebservice.asmx.

ideas?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,256 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,031 Reputation points
    2023-02-23T18:29:13.9266667+00:00

    handlers and modules must be registered in the web.config, as it configuration for IIS.

    https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/aspnet/development/http-modules-handlers

    the hack approach is for the library to read and update the web.config. but something would need to call the module. if using the owin pipeline, you could use a startup attribute.

    0 comments No comments