I'm having a bit of trouble with my web.debug.config
and web.release.config
files.
To be more specific, my webpage will only use the default web.config
file, and completely ignore the debug
and release
files.
This happens not only when I run the project locally, but also when I publish it to an IIS server.
I am using Visual Studio 2010 Ultimate (no Service Pack).
Here are the config files:
web.config
:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="MyConn" connectionString="SomeConnectionString"
providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
web.debug.config
and web.release.config
:
<?xml version="1.0"?>
<configuration xmlns:xtd="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyConn" connectionString="SomeOtherConnectionString"
providerName="System.Data.SqlClient"
xtd:Transform="Replace"
xtd:Locator="Match(name)"/>
</connectionStrings>
</configuration>
As I mentioned before, the website uses the connection string from the web.config
file, and not from the web.release.config
.
Another interesting point is that in the physical folder to which I published the project, all three config
files exist; each exactly the same as they appear in the VS solution.
Suggestions, anyone?