If I put a breakpoint in the "await next.Invoke();" it never gets hit nor does the Invoke method on my GlobalizationMiddleware (the constructor does though). I've tried placing it before and after every UseUmbracoxxx callI without any progress. Is it something the umbraco is doing to bypass my middlewares? Is there a way arround it?
It looks like Umbraco registers itself to handle all requests, and when a middleware handles a request, it doesn't need to pass it on to the next middleware :). I would imagine you could register an endpoint of your own, or you could add your own controller. You also could register a middleware using an IStartupFilter, like in the example below, to get into the pipeline before Umbraco.
I was on a small holiday that's why I'm only answer today.
Using the startup filter like you said did work but it doesn't work for my use case because I need to access the session and at that time the Session Property returns an InvalidOperationException.
I'm thinking of using instead a base controller that overrides OnActionExecuting and doing the GlobalizationMiddleware operations there.
Custom Middleware
Hi,
I have the following Configure method on Startup:
If I put a breakpoint in the "await next.Invoke();" it never gets hit nor does the Invoke method on my GlobalizationMiddleware (the constructor does though). I've tried placing it before and after every UseUmbracoxxx callI without any progress. Is it something the umbraco is doing to bypass my middlewares? Is there a way arround it?
Thanks,
Joao
It looks like Umbraco registers itself to handle all requests, and when a middleware handles a request, it doesn't need to pass it on to the next middleware :). I would imagine you could register an endpoint of your own, or you could add your own controller. You also could register a middleware using an IStartupFilter, like in the example below, to get into the pipeline before Umbraco.
Hi,
I was on a small holiday that's why I'm only answer today.
Using the startup filter like you said did work but it doesn't work for my use case because I need to access the session and at that time the Session Property returns an InvalidOperationException.
I'm thinking of using instead a base controller that overrides OnActionExecuting and doing the GlobalizationMiddleware operations there.
Joao
is working on a reply...