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

Page History: Transforming External Configuration Files - Visual Studio 2010

Compare Page Revisions



« Older Revision - Back to Page History - Current Revision


Page Revision: Thu, Jun 14, 2012, 4:18 PM


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-2024, Patrick Jasinski.