I have recently started using Web Deploy with IIS 7 on the server and Visual Studio 2012. My project in question is an ASP.Net MVC 3 web application.
I have set it all up correctly and the publishing is working and I get the desired connection string transformation so the target server can access the correct database.
However, there are a couple of appSettings
that need to be different on the server than the values used for development on local machine.
Lets say for this example I have a development web.config with the following:
<appSettings>
<add key="CommonName" value="AlwaysTheSame" />
<add key="VariableName" value="LocalValue" />
<appSettings>
and when it gets published I want it to be as follows on the server:
<appSettings>
<add key="CommonName" value="AlwaysTheSame" />
<add key="VariableName" value="ServerValue" />
<appSettings>
I am thinking I need to change something in the .pubxml
file which is found in the Properties > PublishProfiles
folder as this seems to be how the connection string is changed. However, I am not finding any useful information about how to modify this file to suit my needs. What changes do I need to make?