Search code examples
c#visual-studio-2012publishmsdeploy

msdeploy inside visual studio publish profile


How do i use my custom msdeploy and msbuild community task script from VS 2010 web deployment project inside a visual studio 2012 publish profile?

My script in VS2010 builds to a local directory and then makes a few modifications to the generated files and sends it up. This is all tied to the specific configuration that is selected for example: Test, stage, production configurations.

For some reason i cannot see how this plays out using the publish feature in VS 2012


Solution

  • In VS 2012 you can have a core web.config and then multiple web.configs for each configuration that you build such as web.debug.config etc.

    When you build and publish, based on the configuration you choose a web.config is generated on the fly which combines the parent web.config and the configuration specific web.config (based on what you specify, replace, add etc).

    Then msdeploy is invoked to generate a web deploy package of this which is of type iisApp by default unless you specify include IIS settings.

    This package is deployed to the server you specify. If you have database connection strings etc, they will be replaced during publish to the server side values if you have specified them using web deploy parameterization.