如何为 IIS 网站创建 Web 部署包并使用标准清单/参数

发布于 2024-09-26 03:46:31 字数 598 浏览 2 评论 0原文

我有各种带有简单 svc 文件等的 IIS 托管服务主机。我想要做的是能够使用 IIS 导出包从我们的测试服务器创建部署包,以便在导出时保存和选取参数,以便导出是可重复且可自动化的。即,导出将始终使用必要的清单扩展,例如 XmlFile 等。

这些网站存在于解决方案中,然后使用每个解决方案中的 Web 部署项目来选取,以便完成配置替换等。

我们目前使用的是 VS 2008 SP1所以无法直接访问 VS 2010

我对 MsBuild(在 TeamCity 中运行)遇到的第一个问题是,当没有项目文件时如何构建 IIS 网站(使用 target=Package)?通过这种方式,也许我可以避免 Web 部署项目(我将它们用于各种配置,但不想以这种方式部署到生产,而是从我们完全测试的暂存中导出到包文件中,然后导入到生产中服务器)。

其次,我想避免每次运行 IIS 7 时都必须配置导出。我希望它只是选择正确的扩展集来使用并为我创建必要的参数。这是通过清单文件完成的吗?我可以看到如何使用parameters.xml,但我不清楚是否需要使用manifest.xml(手动创建)以及如何链接它。这个想法是测试人员/部署人员应该能够执行以下操作无需启用所有所需的扩展即可轻松导出

任何帮助或指导将不胜感激。

I have various IIS hosted service hosts with simple svc files etc. What I want to do is to be able to create deployment packages from our test server using IIS Export Package in a way that parameters may be saved and picked up at Export time so that the Export is repeatable and automatable. I.e. the Export will always use the necessary Manifest extensions such as XmlFile etc.

The web sites exist in the solutions and are then picked up using a Web Deployment project in each solution so that config substitutions are done etc.

We are currently on VS 2008 SP1 so do not have direct access to VS 2010

The first issue I have with MsBuild (running in TeamCity) is how to build the IIS web site (with target=Package) when there is no project file? In this way maybe I can avoid the Web Deployment projects (I use them for various configurations but don't want to do it this way for deploying to Production but rather export from our fully tested staging into a package file to be imported onto a production server).

Secondly, I want to avoid having to configure the Export in IIS 7 each time I run it. I want it simply to pick up the correct set of extensions to use and create the necessary parameters for me. Is this done from a Manifest file? I can see how to use the parameters.xml but I am unclear whether I need to use a manifest.xml (created by hand) and how to link it in. The idea is that a tester/deployment person should be able to do the Export simply without having to enable all of the extensions that are required

Any help or guidance will be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自找没趣 2024-10-03 03:46:31

好吧,与此同时我已经弄清楚了。

我最终使用了 打包 Windows Web 应用程序库的应用程序,这为我提供了在 TeamCity 中扩展自动构建以创建“可重复”导出包的方法。

简而言之,我将使用当前的 Web 部署项目来创建部署工件,然后在 MsBuild 中将它们与预先准备的manifest.xml 和parameters.xml 文件组合到Build artefacts 文件夹中,并将它们压缩到一个包中。从那里,任务是将包导入到目标环境中的 IIS Deploy 中。

parameters.xml 文件将用于设置 wcf 客户端和服务的主机名、连接字符串、应用程序设置等。

事实证明,这是最好的解决方案,因为我可以将其放入我们的自动构建中。

Ok, in the meantime I got it figured out.

I ended up using the document at Package an Application for the Windows Web Application Gallery which gave me the means by which I could extend our automated build in TeamCity to create the "repeatable" export packages.

In short I will use the current Web Deployment Projects to create the deployment artefacts and then in MsBuild combine them with the pre-prepared manifest.xml and parameters.xml files into Build artefacts folder and zip them up into a package. From there the task will be to Import the package into IIS Deploy in the target environment.

The parameters.xml file will be used to set the HostName for wcf clients and services, connection strings, app settings etc.

This turned out to be the best solutuion bcause I can put it into our automated build.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文