8

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.

1 Answer 1

6

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…

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.