Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christo 23 posts 44 karma points
    Dec 01, 2010 @ 14:18
    Christo
    0

    two different settings files on Dev and Prod

    hi there,

    is there a way to create two different

    umbracoSettings.config -Files. One for Dev and one for PROD?

    I'd like to add the load balancing settings e.g. for prod only there and not on the DEV environment. And logging settings are different as well

    The best wuold be to point in the web.config to the umbracoSettings.config file and just upload onw web.config to DEV(or Stage or whatever) and one to  PROD.

    Is there a way to acheive this?

     

    Thanks

    Christo

     

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Dec 01, 2010 @ 23:48
    Aaron Powell
    0

    Yes there's a number of ways which you can do this, depending on how you're doing your release strategy.

    With the Umbraco core we actually have it configured so you can have different web.config settings per machine (so each dev can have what they need) and we do this by using an XSLT that runs as part of the build process, it looks at the machine name and then looks for a transform file that matches it.

    You could use something similar, so when you compile it looks for "DEV", "STAGING" or "PROD" and then applies the appropriate transforms (here's an article that outlines it to an extent: http://cjgiddings.wordpress.com/2009/04/30/setting-up-umbraco-correctly-with-msbuild/).

    Alternatively you could go with the Web Deploy stuff that came with VS2010, it has in-built config transforms (which I'm now more of a fan of than the XSLT stuff above), if you google around you'll find plenty of info on how to do it.

    Lastly you could just have 3 different files completely and just use xcopy as part of the build to copy the right one into the right place.

Please Sign in or register to post replies

Write your reply to:

Draft