I am trying to configure an ASP.NET MVC application that will use one of two MvcApplication derived classes, depending on the context under which the application is running.
The primary web application, which contains all production code, views, etc. has the standard class derived from MvcApplication in global.asax. What I want is to have another class that is used during web testing (Selenium based browser tests). I want all the resources, code, view, etc from the web application to be used except for the global.axax/MvcApplication class.
The testing site needs a different global.asax so that I can set up the container differently, and configure some other settings (e.g., logging, tracing, etc) that are helpful during test, but don’t make sense for production.
Does anyone know if this is possible, and if so, how to do it?
Thanks,
Erick
I think you can move your bootstrap code in a two difference class one for debug and other for production that implement the same interface : IBootstrapProvider, and in your global asax you initialize One of those depending from a parameter in the web config!
This solution works for me!
I understand good your question?
Hope can help you
Marco