Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Transforming External Configuration Files - Visual Studio 2010

RSS
Modified on Sat, Oct 27, 2012, 11:31 AM by Administrator Categorized as Visual Studio and Developer Tools

Overview

When externalizing configurations settings using the configSource attribute, the web.config transformations don't apply. This article describes a work-around.

<connectionStrings configSource="App_Config\ConnectionStrings.config" />

Solution

1. Create ConnectionStrings.BuildConfigName.config for each build configuration

2. Add a post-build event using the following code.

copy /y "$(ProjectDir)App_Config\ConnectionStrings.$(ConfigurationName).config" "$(ProjectDir)App_Config\ConnectionStrings.config"

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2018, Patrick Jasinski.