Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSDeploy skip root web.config

Tags:

msdeploy

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.

like image 230
Rots Avatar asked Nov 02 '22 22:11

Rots


1 Answers

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.

like image 187
Rots Avatar answered Nov 08 '22 08:11

Rots