Web Deploy and Parameters.xml: how to share parameters between multiple projects

I have a number of web applications in the suite. I use Web Deploy to publish deployment packages that I create using Visual Studio. The SetParameters.xml file is supplied with these packages, which you can use to change the values ​​in web.config. Several values ​​are executed automatically, for example, connection strings, but you can add the parameters.xml file to the project to specify values ​​that should be parameterizable:

<?xml version="1.0" encoding="utf-8" ?> <parameters> <parameter name="Sharepoint service principal name" description="The principal name of the Sharepoint service." defaultValue="host/108.125.111.137"> <parameterEntry kind="XmlFile" scope="\\Web\.config$" match="/configuration/system.serviceModel/client/endpoint/identity/servicePrincipalName/@value"/> </parameter> </parameters> 

My question is: if all my web applications have an application parameter in web.config with the same key and value that I want to change during deployment, how can I avoid duplicating a specific parameter in each parameters.xml file? Is there a way to place this tag in one place and use each options.xml parameter in a common location?

+4
source share
1 answer

If you are using RT2010 RTM web publishing, then no.

However, if you are using VS2012 (or VS2010 + Azure SDK), you can simply define parameter files declaring optional ParametersXMLFiles in your project file, wpp.targets or publish a profile:

 <ItemGroup> <ParametersXMLFiles Include="$(SolutionDir)\CommonParameters.xml" /> <ItemGroup> 

They will be combined with Parameters.xml in each project root and with any parameters declared in your package publishing profile using MsDeployDeclareParameters .

+6
source

All Articles