Change commerce server site programmatically in a web app-Collection of common programming errors


  • msdn

    Is it possible to connect to different commerce server site programmatically in one web app? As what I know, the commerce server site name is specified in in web.config file. So it seems that one web app can only use one commerce server site. If it is possible, how to do it?


  • msdn1 I don’t think this is possible in commerce server. Couple of options are striking my  mind – Create multiple web sites that points to different commerce server sites and route the user to the website site based on some criteria. – You can replace code from runtime API to agent mode or local mode then you can able to control using code but you can’t perform all the operation with agent/local mode API. Hope this helps. Regards,

    -Ravi Kanth Koppala


  • msdn2

    I think this would have to happen before the Application_Start Event. In that case you wouldn’t be able to intercept requests and route them. However you could do some clever urlrewriting to different Application Pools each hosting their own site.

    I would travel down that path.


  • msdn3

    Thanks for reply. However, having multip web site is not an option for us. On web app is the requirement. But it is good to know that it is not possible too.