I have the following as part of a "Deploy" project which I run manually from a batch file using msbuild.exe (VS2017).