Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Problem Updating Web.config via MSDeploy Command Line

$
0
0
Hi there,

Background info:
We have a 3 server set up (dev, staging & production) for an ASP.NET MVC 3 site. I use Visual Studio to publish to the dev server. From there, I can sync from dev to staging or staging to production with a custom batch file that uses msdeploy. This all works great.

The problem:
I'd like to alter some of the web.config appSettings when going from staging to production (turning off certain developer-only settings, for instance). When I add the "setParam" switch (see below), it attempts to change all web.config files in the site EXCEPT the root web.config. (For example, it finds and updates /Views/web.config but not /web.config)

Current msdeploy command line example (this works):

msdeploy.exe
-verb:sync
-source:contentPath="Our Site",wmsvc=dev.oursite.com,userName=%User%,password=%Pass%
-dest:contentPath="Our Site",wmsvc=staging.oursite.com,userName=%User%,password=%Pass%
-allowUntrusted=true
-enableRule:DoNotDeleteRule
-skip:Directory="\\Dir\\SubDir"

What I've tried to do (this skips /web.config, but finds /Views/web.config):

-setParam:
kind=XmlFile,
scope=web.config$,
match=/configuration/appSettings/add[@key='AttributeToChange'],
value=false

Am I missing something? Can I not update the root web.config file this way? Thanks for reading!

-Chris

Viewing all articles
Browse latest Browse all 27852

Trending Articles