Anders G. Nordby

Lead Consultant at Itera

Monthly Archives: April 2012

Using xml transform with episerver.config

I know this has been posted elsewhere before, but I spent some time lately to figure this out again… And so, I thought I’d post this as a note to myself – to make my life easier next time I wonder why the xml transforms do not work with the episerver.config file of an EPiServer site.

I still remember the joy I felt when I saw the Web Deployment Made Awesome: If You’re Using XCopy, You’re Doing It Wrong video – note how the audience is clapping. Well, that’s two years ago, and xml transform for the config files has been the .Net standard since then.

However, things don’t work so well with the episerver.config file in EPiServer CMS. There’s a simple trick to make it work, however…

This is how the top of the episerver.config file normally looks:

<?xml version="1.0" encoding="utf-8"?>
<episerver xmlns="http://EPiServer.Configuration.EPiServerSection">
  <sites>
...

Simply remove the namespace, like this:

<?xml version="1.0" encoding="utf-8"?>
<episerver>
  <sites>
...

Now, you can use transform files, just as you can with Web.config and connectionStrings.config and all your other config files.

Advertisements