Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web.Config Debug/Release : Doesn't work

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?

like image 610
Portekoi Avatar asked Dec 15 '22 09:12

Portekoi


1 Answers

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.

like image 166
Tim B Avatar answered Dec 28 '22 20:12

Tim B