Copied to clipboard

Flag this post as spam?

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


  • Danny 15 posts 136 karma points
    Oct 16, 2014 @ 01:01
    Danny
    0

    Deploying different umbracoSettings.config for different environments

    I have an Umbraco site on a load balanced environment, where the site files are stored on a centralized network share, as describe on this wiki, http://our.umbraco.org/documentation/Installation/load-balancing. ;

    This configuration requires that I enable distributedCall and list each of the servers in the environment in umbracoSettings.config. Right now I have this set up in a test environment, but for production I will need to have a different set of servers in the umbracoSettings.config.

    Is there an Umbraco deployment tool where you can define different environments with different configuration files? Does Courier handle scenario at all?

    Thanks in advance.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Oct 16, 2014 @ 18:04
    Dave Woestenborghs
    0

    In Visual studio you can apply config transforms for different environment.

    To use it on the umbracosettings.config file you will need to install VS extension called SlowCheetah.

    Dave

  • Diogo 8 posts 82 karma points
    Sep 29, 2016 @ 16:37
    Diogo
    5

    A bit late on this reply but maybe this can help someone eventually

    You can change your .csproj to run xmltransforms on all the .config files on the /Config folder and subfolders. Just add this snippet and when you publish under a certain configuration, if you have a config transform for that configuration, it will just use it.

    <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />
      <Target Name="UmbracoConfigsTransform" AfterTargets="GatherAllFilesToPublish">
        <ItemGroup>
            <UmbracoConfigFiles Include="Config\**\*.config" Exclude=".\Config\**\*.*.config" />
        </ItemGroup>
        <Message        Condition=" Exists('%(RelativeDir)%(Filename).$(Configuration)%(Extension)') " 
                        Text="Config Transform: Source=@(UmbracoConfigFiles->'%(FullPath)') Destination=$(WPPAllFilesInSingleFolder)\%(RelativeDir)%(Filename)%(Extension) Transform=%(RelativeDir)%(Filename).$(Configuration)%(Extension)" 
                        Importance="high" />
        <TransformXml   Condition=" Exists('%(RelativeDir)%(Filename).$(Configuration)%(Extension)') " 
                        Source="@(UmbracoConfigFiles->'%(FullPath)')" 
                        Destination="@(UmbracoConfigFiles->'$(WPPAllFilesInSingleFolder)\%(RelativeDir)%(Filename)%(Extension)')" 
                        Transform="%(RelativeDir)%(Filename).$(Configuration)%(Extension)" />
      </Target>
    

    So no need for any plugin actually.

  • David Peck 690 posts 1896 karma points c-trib
    Apr 20, 2017 @ 12:27
    David Peck
    0

    This saved my sanity. Thanks Diogo.

    As an FYI I found that I needed to use: <Target ... AfterTargets="CopyAllFilesToSingleFolderForMsdeploy">

    Also to increament the client dependency framework version id checkout this topic.

Please Sign in or register to post replies

Write your reply to:

Draft