In my current project, I have some connection strings that are valid for local development machines:
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="Data Source=localhost;Initial Catalog=MyDB;Integrated Security=SSPI"
</connectionStrings>
....
</configuration>
How would I use the Web.Config transforms to convert from this expression to one valid for our production server? The production server one would look something like:
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="Data Source=IPAddress,Port;Initial Catalog=SomeOtherDB;User ID=TopSecretUsername;Password=SecurePassword"
</connectionStrings>
....
</configuration>
The syntax isn't obvious to me, and I'm completely failing at grokking the page on it.
This works for me but I too have found it to be a bit flakey at times. You will need to create another file called Web.Config.Release and fill it with the following:
You shouldn't need to create a new file, it should be in the Solution Explorer, expand Web.config, and open Web.Release.config.
Scott Allan has a good video on it here (under Configuration and Deployment > Config Transformations).