How to specify MSDeploy parameters from MSbuild

11,442

Ok so turns out this is fairly easy, after some significant googling eventually found this post

http://vishaljoshi.blogspot.com/2010/07/web-deploy-parameterization-in-action.html

VS 2010 makes your life easier by allowing you to simply drop the Parameters file in the root of your web project and if a file with the name Parameters.xml is found in the root of your project it passes it to Web Deploy which then parameterizes your web…

Share:
11,442
Bluephlame
Author by

Bluephlame

I am the Technology Development Manager at Compassion Australia. We use C# and the associated Micosoft stack of technologies. I also build iPhone apps on the side.

Updated on June 16, 2022

Comments

  • Bluephlame
    Bluephlame almost 2 years

    I have a web application that I am trying to deploy and have the web.config file parametrised. I can build the package by running

    msbuild myproj.csproj /T:package

    now when it produces the package, i get a file in the directory.

    Archive.SetParameters.Xml

    This file has Parameters in it that if I change they would end up in the deployed package. My Question is, how can i define more parameters so that when I build the project it has my extra parameters in the file.

    I belive i could do it using MSDeploy -declareParam But how would I do this from MSBuild? or the .csproj file.

    My end goal is to have a parametrised Web.config file for deployment into multiple environments.

  • nicojs
    nicojs over 12 years
    Thanks a lot! I was searching for this for hours. Don't know why it is so hard to find this.