Question

My SignalR Startup-class looks like this

namespace Website
{
    public sealed class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }
}

So - I am going for the default routing

Then I have added a module to my web.config (for IIS 6 and IIS 7)

<configuration>
    <system.web>
        <httpModules>
            <add name="FooModule" type="FooNamespace.FooModule" />
        </httpModules>
    </system.web>
    <system.webServer>
        <modules>
            <add name="FooModule" type="FooNamespace.FooModule" />
        </modules>
    </system.webServer>
</configuration>

I got some exception in my handler - which is not the issue here, but which showed me, that the handler is also executed in the SignalR pipe.

Well, what are location-tags for?

<location path="signalr">
    <system.web>
        <httpModules>
            <remove name="FooModule" />
        </httpModules>
    </system.web>
    <system.webServer>
        <modules>
            <remove name="FooModule" />
        </modules>
    </system.webServer>
</location>

I though I was good to go ... Well, I am still receiving the exception in the SignalR pipe. I even enabled FailedRequestTracing, to get a full list of the executed modules - and guess what ... FooModule is still showing up.

So, my questio is: How can I remove certain modules from the pipe, when serving a SignalR request?

Was it helpful?

Solution

The httpModules section affects all the application, it won't work that way.

Modules run for all requests no matter to which handler are directed.

Your best option is to tackle the problem in the module.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top