MSDeploy - 提示输入参数
我有一个使用 Visual Studio 2010 构建的 Web 部署包。我定义了一个Parameters.xml 文件,其中包括所有参数、描述和默认值。
在 IIS 7 中部署 Web 应用程序时,它将自动查看参数并为用户构建 GUI,如下所示 此处。
有谁知道 IIS 6 中的任何等效项吗?我们需要在本地运行部署,因此 Web 部署不是一个选项。现在,我计划使用生成的 ProductName.deploy.cmd 文件来安装该软件包。但是(据我所知)使用此方法设置参数的唯一方法是填充 ProductName.SetParameters.xml 文件。此文件不包含原始Parameters.xml 文件中的任何描述。它只是一组键/值对。
运行 msdeploy 时有什么方法可以提示用户输入参数(包括参数说明)?或者我在使用 IIS 7 之前运气不好?
I've got a web deployment package I've built using Visual Studio 2010. I've defined a Parameters.xml file, which includes all of the parameters, descriptions, and default values.
When deploying a web application in IIS 7, it will automatically look at the parameters and build a GUI for the user, as seen here.
Does anyone know of any equivalent in IIS 6? We need to run the deployment locally, so Web Deploy isn't an option. Right now, I'm planning on using the generated ProductName.deploy.cmd file to install the package. But (as far as I can tell) the only way to set parameters with this method is to populate the ProductName.SetParameters.xml file. This file doesn't contain any of the descriptions from the original Parameters.xml file. It's just a set of key/value pairs.
Is there any way to prompt users for parameters - including the parameter descriptions - when running msdeploy? Or am I out of luck until I can use IIS 7?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有像您正在寻找的针对 IIS 6 的 UI。
话虽如此,我刚刚发布了一个 Nuget 包,我认为这对您有帮助,请在 http://sedodream.com/2011/12/24/PackageOncePublishAnywhere.aspx。给你总结一下为什么我认为它会对你有所帮助,因为安装 Nuget 包后,当你在 VS 中从 Web 项目创建包时,将会生成一个 .ps1 文件。当您执行该 .ps1 文件时,它将引导您完成发布,其中一方面是提示输入参数值。它提示输入两种类型的值:
基于#2,如果您在调用发布时声明了任何参数,系统将提示您输入这些参数,并且会显示默认值。例如,看一下下图(绿色文本是参数名称,青色文本是默认值)。
基于此线程,我刚刚意识到我没有显示参数的描述,但我'我想知道这是否会带来太多信息。如果您在这方面有任何想法,请告诉我。
请注意,为了让此功能在此时为您工作,您需要在运行发布的计算机上安装以下软件:
如果您想做类似的事情,请提供一些如何实现的信息/o 使用我的扩展这里是信息。
MSDeploy 有一个动词 getParameters,它可用于确定包中存在的所有参数。例如我们可以执行命令
,结果如下所示。
获得该 XML 后,您可以创建所需的任何提示/流程。
I don't think that there is a UI like what you are looking for targeting IIS 6.
With that being said I have just released a Nuget package which I think would be helpful to you, read more at http://sedodream.com/2011/12/24/PackageOncePublishAnywhere.aspx. To give you a summary of why I think that it will help you is that after installing the Nuget package when you create a package from the web project in VS there will be a .ps1 file generated. When you execute that .ps1 file it will walk you through a publish, and one aspect of that is prompting for the parameter values. It prompts for two types of values:
Based on #2 if you had any parameters declared when you invoked a publish you would be prompted for them, and it will show you the default value. For example take a look at the image below (green text is the param name, cyan text is the default value).
Based on this thread I just realized that I'm not showing the description for the parameters, but I'm wondering if that would be too much info. Let me know if you have any thoughts in this area.
Note in order for this to work for you at this time you'll need the following installed on the machine running the publish:
To give some info how this is implemented in case you want to do something similar w/o using my extension here is the info.
MSDeploy has a verb, getParameters, which can be used to determine all the parameters which exist for a package. For example we can execute the command
And the result would be what's shown below.
After you have that XML you can create whatever prompts/processes you want.