Search code examples
publishmsdeploy

How can you vary an image using msdeploy?


I have a web application I want to publish to multiple different clients, each with their own logo. I'm using 'publish web' from visual studio to do my deployment. The only way I can think to change it is to have a setting in web.config which I use to decide which logo to display, but this doesn't seem very nice, not least because I'd have to deploy all the logos to every site. Is there a correct or just better way to achieve this?


Solution

  • There is no way to do this in a single deploy without also uploading all your images. However, you can do it with two deploys:

    1. Deploy the site while skipping logo.jpg (and optionally your logos folder if it's stored inside the web root)
    2. Deploy just the file as a different filename:

    _

    msdeploy.exe -verb:sync ^
                 -source:contentPath=path\to\src\images\logos\logo1.jpg ^
                 -dest:contentPath=sitename\images\logo.jpg