I can't get msdeploy
to skip only the root web.config (I want to keep any web.config files that exist in sub folders below the root)
This is the parameter I am using:
-skip:objectName=filePath,absolutePath=^\\web\.config
I have tried ^\\web\.config
, \\web\.config
and the absolute path to the file, e.g.: C:\\Some Path\\web\.config
. None of those seem to work.
I managed to sort this out.
You have to use the full source path in order to skip the target root web.config only. msdeploy
appears to use the source path for this regex filter.
like this:
-skip:objectName=filePath,absolutePath=\\\\servername\\c\$\\syncpath\\web\.config
Hope this helps somebody else out in the future.
EDIT - ADDITIONAL INFORMATION
On top of this, if you are skipping a web.config file in a sub directory you also need that target dir and web.config in the regex, like so:
-skip:objectName=filePath,absolutePath=\\\\servername\\c\$\\syncpath\\web\.config|TargetFolder\\web\.config
This will stop msdeploy from issuing a delete directive on the target web.config.
Note that the regex compare is case-insensitive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With