Visual Studio - Publish to multiple locations?
-
22-08-2019 - |
Question
Is there a way to automatically publish a website to multiple locations at once?
Our website is load balanced across multiple servers, so when I want to publish I have to do it to each server individually.
Thx, Trev
Solution
Perhaps with some build scripts, such as MSBuild? Or perhaps you could create a script (PowerShell, VBScript, whatever), which copies all contents of a directory, and invoke it in the post build event (configurable in Visual Studio), so that once your solution (or the last project, actually) is built the script will run and copy the output files to wherever you need them.
OTHER TIPS
MSDeploy is setup to handle this using multiple Configurations for each location. Scott Hanselman presented on this at Mix '10
or just use multiple publish commands. one for each location.