2

I have a (for the time being) rather simple site manifest

<sitemanifest>
<IisApp path="c:\pathtosite" />
<dbFullSql path="Data Source=.\SQLEXPRESS;Initial Catalog=table;User Id=user;Password=pwd" includeIfNotExists="true" includeData="false" transacted="true" />
</sitemanifest>

The dbFullSql provider results in promting for a connection string when importing the site through IIS7.5. I'd love to reuse the information provided to update the web.config connection string but have no idea on how to achieve this

1 Answer 1

2

It sounds like you would like to use parameters to me... When you import a package in the IIS inetmgr UI default parameters are created for each of the providers, which is why you get that prompt for the connection string. However you can also add explicit parameters when you create the package. If you're doing this with the msdeploy.exe cmd line, you can put the parameters in a file and then add a -declareParamFile: to your package command to add them. The parameter for the database would probably be something like this - this says to use the provided connection string for both the dbFullSql provider path and replace whatever's in the connectionStrings section of web.config:

<parameter name="ConnectionString" description="Connection string for my database" defaultValue="Data Source=.\SQLExpress;Initial Catalog=table;User Id=user;Password=pwd" >
    <parameterEntry type="ProviderPath" scope="dbfullsql" match="Data\ Source=" />
    <parameterEntry type="XmlFile" scope="\\web.config$" match="//connectionStrings/add/@connectionString" />
</parameter>

More parameter examples/resources here: http://learn.iis.net/page.aspx/722/reference-for-the-web-application-package/ AND http://technet.microsoft.com/en-us/library/dd569084(v=WS.10).aspx

If you have other Web Deploy questions please try our forum on IIS.net (http://forums.iis.net/1144.aspx).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.