Jeff Wallace
Nov 2, 2012
visibility 6861
star star star star star
(0 votes)

Developers: Before You Build that Alloy 7 Project…

Based on EPiServer 7 and the new Alloy templates

If you have been able to get your hands on EPiServer 7 or experienced any kind of demo you’ll probably be pretty excited about it.  It’s pretty slick!  Since there’s plenty of blogs that tell this story already I won’t re-hash the greatness in this one.  Instead I want to make sure you are aware of a change to the Alloy template project before you build for the first time.

 

The new project includes some post build steps that will copy some of the configs from a new location in the file/project structure over to the root. 

 

image

Post Build Events

 

One of my colleagues explained this process based on some information that was presented at one of the summits this week:


“Every time the project is built, the following is executed by the MSBuild scripts in the [MSBuild] folder:

1. Retrieve default EPiServer configuration files from the "[Configuration]\EPiServer" folder
2. Apply common config transforms from the "[Configuration]\Common" folder
3. Apply build configuration-specific transforms from the "[Configuration]\BUILDCONFIGNAME" folder
(where BUILDCONFIGNAME is the current build configuration name, such as "Debug" or "Release")
4. Overwrite any existing configuration files in the site root

Note: The MSBuild scripts are executed through a post-build event.
Make sure all files in this folder have their Build Action set to "None" to avoid this folder being included when performing a Publish”

 

You’ll also find the above conveniently placed in “_ReadMe.txt” in the Alloy project under the “[Configuration]” folder.

 

image image

[MSBuild] folder and [Configuration] folders

 

You might notice the “Web.config.ReadMe.txt” file in the site root also reads as follows:

“Note that the Web.config file in the root should not be modified directly as it will be overwritten every time the web application is built (because of config transforms).

Configuration changes should be done in the [Configuration] folder.

See the readme file in the [Configuration] folder for detail”

 

Obviously, in general, this is good knowledge to have for Alloy.  Developers who build Add-on modules that update configs, via Nuget or otherwise, may want to account for this in the current project state or if this approach is to be carried forward in other projects.  If developers do not account for this by adding these changes below the “[Configuration]” folder their changes may be overwritten when a build occurs.  Site owner Add-ons should not update the configs but that’s a different story.

 

It appears that the CMO module has this issue since it updates configs such as web.config, episerverframework.config, connectionstrings.config, etc at the site root.  It does not update the files under [Configuration] currently.  What this means to you is that if you install CMO on a standard Alloy 7 site and build your project the CMO configs will be overwritten and CMO will no longer be available in the UI.

 

For the time being you have a couple of obvious choices:

1) Update the configs appropriately under the “[Configuration]” folder to included any necessary changes

2) Remove the post build steps – this is more of a  workaround of the intended build process so not the best long term approach

 

UPDATE: Ted Nyberg has provided an excellent article explaining technical details on the new templates including the config transforms.

 

Now that you are “in the know” get back to enjoying this excellent new release!

Nov 02, 2012

Comments

Nov 3, 2012 11:57 AM

A workaround for installing modules on Alloy is also described here: http://world.episerver.com/Documentation/Items/Installation-Instructions/Installation-Instructions---EPiServer-7/Modules-and-Alloy-Templates-Configuration/

Jeff Wallace
Jeff Wallace Nov 3, 2012 02:36 PM

Great point Sergii. Thanks for adding that link!

Apr 15, 2013 07:25 AM

Still not very sure how to do it before building the Alloy project.

mattias_jonsson_cycom
mattias_jonsson_cycom Apr 23, 2013 01:51 PM

Thanks a lot for helping me fix this problem!

error Please login to comment.
Latest blogs
Exploring Asset Lifecycle Management Approaches for Bynder and Optimizely SaaS CMS

Note: This is Part 3 of our Bynder integration series. For setup and filtering prerequisites, see Part 1  and  Part 2 . Introduction In my previous...

Vipin Banka | Jul 5, 2026

Unlock AI-Ready Experiences with Optimizely

Over the past few months, almost every customer conversation has shifted from SEO to AI readiness. The questions are no longer just: “How do we......

Madhu | Jul 5, 2026 |

Planning Your Bynder DAM and Optimizely SaaS CMS Integration the Right Way: Avoiding Asset Sprawl and Unnecessary Synchronization

Note: This is Part 2 of our Bynder integration series. If you missed the Part 1, check out " Implementing the Bynder DAM Connector with Optimizely...

Vipin Banka | Jul 4, 2026

Implementing the Bynder DAM Connector with Optimizely SaaS CMS: Lessons Learned

What I learned while integrating Bynder DAM with Optimizely SaaS CMS, exploring Optimizely Graph, and building a headless frontend experience....

Vipin Banka | Jul 3, 2026

Optimizely London developer meetup 2026: a round up

Well, what can I say? Last night we wrapped up! Yet another London Developer Meetup, hosted at the superb Lightwell venue And this is also a...

Scott Reed | Jul 3, 2026

AvantiBit Custom Settings for Optimizely CMS

AvantiBit Custom Settings is a free, Apache-2.0 Optimizely CMS add-on for typed, site- and language-aware configuration that stays out of content...

Enes Bajramovic | Jul 3, 2026 |