I have a code that registers a route in an Application_AcquireRequestState
application event . Once the routes are registered, I set the flag at the Http runtime cache so that the route registration code does not execute again. There is a specific reason for registering a route in this event Application_AcquireRequestState
.
After restarting the application pool and upon receipt of a request (corresponding to a route), the route registration code is started, but this request is not served by IIS / ASP.Net, and it returns 404. Subsequent valid requests everything works fine.
I want to make sure that even the first request is also correctly executed.
Is it possible to rewrite the request so that after registering the route we can somehow try to reproduce the request if the URL matches one of the registered routes? Is there a solution to solve this problem?
source
share