views:

18

answers:

1

Hello, I'm trying to use the XDT in a 4.0 web application and I just don't figure out how! I know this is maybe weird (At least, all thread I've read since then, everybody seems to do it easly but hum, not me!!). Nothing working. Here's what I've tryed :

Here's my Web.Debug.Config :

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;

  <appSettings xdt:Transform="Replace">
    <add key="ConnectionString.SQL Server (SqlClient)"
     value="data source=test;initial catalog=TestDB;User ID=sa;Password=testpsw;persist security info=False;packet size=4096"  />
  </appSettings>

  <connectionStrings xdt:Transform="Replace">
    <add name="ASP.net Authentication"
     connectionString="data source=(local);initial catalog=TestDB;User ID=sa;Password=testpsw;persist security info=False" />
  </connectionStrings>

</configuration>

In my web.config, I've got this and plenty of other things but I just want to change those.

<?xml version="1.0"?>
[...]
<configuration>

  <appSettings>
    <add key="ConnectionString.SQL Server (SqlClient)"
     value="data source=[THIS WILL CHANGE];initial catalog=[THIS WILL CHANGE];User ID=[THIS WILL CHANGE];Password=[THIS WILL CHANGE];persist security info=False;packet size=4096"  />
  </appSettings>

  <connectionStrings>
    <add name="ASP.net Authentication"
     connectionString="data source=[THIS WILL CHANGE];initial catalog=[THIS WILL CHANGE];User ID=[THIS WILL CHANGE];Password=[THIS WILL CHANGE];persist security info=False" />
  </connectionStrings>

</configuration>
[...]

What I'm doing wrong?

Note : I've read the post from MSDN and it do not helped me...

+1  A: 

To perform a web.config transformation on a web application, you have to deploy the project. Right click on the project and go to Publish.

Just building a project locally will not perform the transformation.

MarkisT
Wow! I was thinking that it was modifying it while we're debugging so you could change connection string to connect to, for exemple, dev or live DB so you could debbug it easly than open you web.config file and change everying relativly to where you want to debug ... Ok! Thank you MarkisT
Simon