3

I'm trying to deploy an ASP.NET MVC 2 app using MsDeploy. I use VS2010 to generate the package as a ZIP. Inside that ZIP is a parameters.xml file that declares the parameters that I can set.

I want to be able to set more parameters, using the auto-generated deploy.cmd file like this:

MySite.deploy.cmd 
    "-setParam:name='IIS Web Application Name',value=MySite" 
    "-setParam:name=IisVirtualDirectoryPhysicalPath,value=C:\inetpub\MySite" 
    "-setParam:name=httpBinding,value=*:80:www.mysite.dk"

That works fine, except for the httpBinding param. That is because that parameter is not declared inside the parameters.xml file that is added to the ZIP container.

I could go and add that parameter declaration manually, but isn't there a way to do it from the command line and have it declare parameters I have in another XML file?

SteveC
  • 15,808
  • 23
  • 102
  • 173
MartinHN
  • 19,542
  • 19
  • 89
  • 131

2 Answers2

2

Are you saying that the value param was not declared when the package was created? If so then I think you would have to add it. Either manually or you can use the -setParam switch and sync the package from and to itself. If you use -setParam with a name which was never declared as a param to begin with I'm pretty sure that value is just ignored.

Sayed Ibrahim Hashimi
  • 43,864
  • 17
  • 144
  • 178
  • Actually, if you use a param that was not previously declared, msdeploy will fail, e.g. `msdeploy.exe [...] -setParam:a=b` yields `Error: Unrecognized argument 'a'. Error count: 1.` I think this is not very reasonable on msdeploy's part, but this is the way it is now. – Jakub Januszkiewicz Oct 20 '11 at 06:21
1

I'm only just looking at this, but is the section on MSDN about the matching of declareParam with setParam the way to go ?

I'm using MsDeploy to update my deployment zip following the idea in this stackoverflow post

Apologies if I'm completely off on this

Community
  • 1
  • 1
SteveC
  • 15,808
  • 23
  • 102
  • 173