How to get Deploy.cmd to fill in replacement fields from Parameters.xml
I have a web application which we are deploying with msdeploy.
I've defined the following parameters.xml file in the project:
<parameters>
<parameter
name="Database Server"
description="Location of your database server."
defaultValue="localhost"
tags="DBServer, SQL">
</parameter>
<parameter
name="Database Name"
description="Name of the database for your application."
defaultValue="MyDatabase" tags="DBName, SQL">
</parameter>
<parameter
name="Database Username"
description="User name to access your application database."
defaultValue="myusername"
tags="SQL, DbUsername">
</parameter>
<parameter
name="Database Password"
description="Password for the Database Username."
defaultValue="mypassword"
tags="SQL, DbUserPassword">
</parameter>
<parameter
name="RTPOne-Web.config Connection String"
description="Connection string to enter into config"
defaultValue="Data Source={Database Server};Initial
Catalog={Database Name};User Id={Database
Username};Password={Database Password};Connection
TimeOut=30;Pooling=false;Max Pool Size=500;"
tags="Hidden, SQL">
<parameterEntry kind="XmlFile" scope="\\web\.config$"
match="//*[local-name()='connectionStrings']/*[local-name()='add'][@name='RTPOne']/@connectionString"
tags="Sql, SqlConnectionString, Hidden" />
<parameterEntry kind="XmlFile" scope="\\web\.config$"
match="//*[local-name()='appSettings']/*[local-name()='add'][@key='DBConnStr']/@value"
tags="" />
</parameter>
</parameters>
The last parameter uses the following replacement fields:
{Database Server}
{Database Name}
{Database Username}
{Database Password}
When I use the "Import Application" option from within IIS 7.5, these
replacement fields are filled in correctly using the values that were
supplied by the other parameters.
However, when I use the Application.Deploy.cmd file to deploy the
application via command line, none of these values are replaced correctly
and I end up with a connection string that looks like this:
Data Source={Database Server};Initial Catalog={Database Name};User
Id={Database Username};Password={Database Password};Connection
TimeOut=30;Pooling=false;Max Pool Size=500;
The Application.SetParameters.xml file that is generated with the
deployment package contains the correct default values. I'm expecting that
the Deploy.cmd batch file should be able to use the default values from
it:
<?xml version="1.0" encoding="utf-8"?>
<parameters>
<setParameter name="IIS Web Application Name" value="Default Web
Site/MyApplication" />
<setParameter name="Database Server" value="localhost" />
<setParameter name="Database Name" value="MyDatabase" />
<setParameter name="Database Username" value="MyUsername" />
<setParameter name="Database Password" value="MyPassword" />
<setParameter name="Web.config Connection String" value="Data
Source={Database Server};Initial Catalog={Database Name};User
Id={Database Username};Password={Database Password};Connection
TimeOut=30;Pooling=false;Max Pool Size=500;" />
</parameters>
Is there anything I can do to get the Deploy.cmd batch file to correctly
substitute these values?
No comments:
Post a Comment