Search code examples
openrasta

Remove a default pipeline contributor


What is the preferred way to remove a default pipeline contributor (OpenRasta 2.0.3)?

I haven't found a lot on that on the net, but one way seems to be writing a custom DependencyRegistrar, i.e. deriving from DefaultDependencyRegistrar and then e.g. overriding AddDefaultContributors(). Apart from that I doubt that it's the best way to remove just a single pipeline contributor, it seems to need additional per-host (ASP vs. InMemory) work, whereas I would consider messing with pipeline handlers to be a host-agnostic affair.

But even if I'd go this route, this guy here seems to have tried it without success: http://groups.google.com/group/openrasta/browse_thread/thread/d72b91e5994f402b I tried similar things, but so far couldn't make my custom registrar replace the default.

So what's the simplest and best way to remove a default pipeline contributor, preferable in a host agnostic way? Is there a working example somewhere?


Solution

  • No, you just need to derive from the registrar and use the protected members that are available to imperatively remove the types you don't want auto-registered.

    The registrar needs to be registered in your container before you provide it to OpenRasta, otherwise the type has been resolved already.