VS2010、MSDeploy 和参数声明
我正在尝试使用 MsDeploy 部署 ASP.NET MVC 2 应用程序。我使用 VS2010 将包生成为 ZIP。该 ZIP 内部是一个 parameters.xml
文件,它声明了我可以设置的参数。
我希望能够使用自动生成的 deploy.cmd
文件设置更多参数,如下所示:
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"
除了 httpBinding param
之外,效果很好。这是因为该参数未在添加到 ZIP 容器的 parameters.xml
文件中声明。
我可以手动添加该参数声明,但是没有办法从命令行执行此操作并让它声明我在另一个 XML 文件中的参数吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是说创建包时未声明值参数吗?如果是这样,那么我认为您必须添加它。您可以手动或使用 -setParam 开关将包与自身同步。如果您将 -setParam 与一个从未声明为参数的名称一起使用,我很确定该值会被忽略。
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.
我只是在看这个,但这是关于 MSDN关于
declareParam
与setParam
的匹配要走什么路?我正在使用 MsDeploy 按照 stackoverflow 发布
如果我完全不同意这个,请道歉
I'm only just looking at this, but is the section on MSDN about the matching of
declareParam
withsetParam
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