I am using servicestack v3. I have two websites(Public services and Storage services) in IIS where the servicestack services are deployed. In the public services website we need to use certain response filters. Whereas they are not required in storage services website.
I was wondering if it is possible to register response filters inside web.config, rather than inside the AppHost.Configure method to make it easy to register them only in websites where they are required and use the same servicestack(AppHost) dlls. I would prefer not to have two different code versions of servicestack(Apphost) dlls. The Apphost code is in C# and the actual services are written in F#.
Thanks.
Eventually, I followed these steps to create configurable plug-in responsefilters:
1) Created dll containing ICustomResponseFilter interface:
2) Created dll containing class for actual response filter that is to be registered which implements above interface:
3) Stored the type names for the filters in database(configuration).
This configuration may be done anywhere else also, eg in web.config
4) A custom Apphost class is used. Inside that class the filters are registered:
5) In every site, the dll containing the interface is mandatory. Whenever a new responsefilter is to be plugged in, we may write a dll containing the class that implements the interface and make an entry in the DB for the filter. The response filter dlls may be used only wherever required. Service stack dll(AppHost) remains same in all sites.