Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have this in my web.config

<add name="AS400" connectionString="Provider=IBMDA400;Data Source=AAAAA;User Id=aaaaaa;Password=aaaaaa;Default Collection=*SYS;" providerName="System.Data.OleDb" lockItem="true"/>

In my Web.Debug.config (The same of Webconfig)

 <add name="AS400" connectionString="Provider=IBMDA400;Data Source=AAAAA;User Id=aaaaaa;Password=aaaaaa;Default Collection=*SYS;" providerName="System.Data.OleDb" lockItem="true" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>

In my Web.Release.config

 <add name="AS400" connectionString="Provider=IBMDA400;Data Source=ZZZZZ;User Id=aaaaaa;Password=aaaaaa;Default Collection=*SYS;" providerName="System.Data.OleDb" lockItem="true"  xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>

But nothing working. If i make F5, in Release mode, i have always the connection string in web.config.

An idea?

share|improve this question
    
If you right click on the file -> preview transform does it work? –  cheesemacfly Jun 12 '13 at 16:10
3  
I believe that is not the way debug and release configs work. They only transform when you do a publish not when debugging in visual studio. I will see if i can find the article from Microsoft that states this. –  user2453734 Jun 12 '13 at 16:20

1 Answer 1

up vote 7 down vote accepted

Configuration transformation is only done when publishing. Your base configuration file should have your development settings. If you choose to use the default build configurations, normally the release transform file should contain your production environment settings and the debug transform file will contain your test environment settings.

Personally, I usually create a new build configuration for testing and for production and leave the debug and release transforms empty.

Edit: If you use the latest version of the SlowCheetah extension for Visual Studio, it will transform your configuration files during the build.

share|improve this answer
    
I didn't publish before. Thank's :) –  Portekoi Jun 13 '13 at 7:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.