Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you parameterize deployments when using ASP.NET 4.5 publish profiles?

The new pubxml files in ASP.NET 4.5 are definitely a step in the right direction. I also like msdeploy's support for parameters.xml files (even though they are sometimes not as powerful as I would like). Now, how do I combine msdeploy's parameters and the pubxml files? I would expect that the pubxml files would allow me to provide a setting like

<ParametersFile>productionParameters.xml</ParametersFile>

or something similar in my production.pubxml file, that would contain values to be merged into web.config when publishing to the production environment. Is that possible or do I have to go back to rolling my own way of determining the parameters file and invoking msdeploy with -setParamFile="productionParameters.xml"?

like image 944
Rune Avatar asked Oct 23 '12 12:10

Rune


1 Answers

You can't set your own parameters file, but you can declare parameter values from within the pubxml:

<ItemGroup>
  <MSDeployParameterValue Include="Parameter Name">
    <ParameterValue>Parameter Value</ParameterValue>
  </MSDeployParameterValue>
</ItemGroup>
like image 181
Richard Szalay Avatar answered Oct 02 '22 14:10

Richard Szalay