Am I right in saying that when running a wisej app. with selfhosting, ashx handlers are not supported?
I’ve just tried it and my handler isn’t working when self-hosted. Works fine in IIS.
Any way around this?
Thank you for sample. It works fine here, but I see what the problem is:
The handler is found and executed correctly.
You get 404 probably because you are not using the handler but the url mapping in web.config, which is a non-existing url mapped to the handler.
localhost:8080/post-data?name=Test returns 404 with the self hosted executable.
You can fix this in WisejMiddleware.cs, see method ProcessSubApplication(IOwinContext context), the last line is:
Change it to:
The mapping doesn’t have an extension so Wisej Middleware tries to execute a sub application. Change that line and the mapping will work. Or you can address the handler directly as shown above.
I’ve attached a simple handler test project which does work in vs, but not in owin.
This is basically the example you gave me a while back.
You’ll see the Wisej.HostService.exe in the project, along with a shortcut. The shortcut is for setting the port and localhost in the arguments.
Actually, I thought you were implementing a custom handler which need to be registered. But .ashx files don’t need to be registered. I just tried with a self hosted app and the sample ashx added by Visual Studio with Add->New Item->Generic Handler and it works without any registration in web.config with Wisej self hosting.
All handlers are supported. It also supports owin middleware modules. The handlers have to go in the classic pipeline section. https://msdn.microsoft.com/en-us/library/46c5ddfy.aspx see Classic Mode section. For owin middleware see https://www.scottbrady91.com/Katana/Creating-OWIN-Middleware-using-Microsoft-Katana
Please login first to submit.