MSBuild 能否通过 MSDeploy 在一个命令中打包并部署到 IIS 6?

发布于 2024-09-30 21:57:50 字数 424 浏览 0 评论 0原文

这就是我想要做的:

  1. 构建一个以“Package”为目标的现有 .csproj
  2. 使用 MSDeploy 将包发布到 IIS 6 服务器

这是针对我尝试一步配置的 TeamCity 构建和发布。我可以创建一个自定义构建文件,但我试图解决这个问题,而不向应用程序添加任何其他配置。

有很多关于 MSBuild 参数的示例,可以通过 WMSVC 进行此发布 - 这是一个很棒的 - 但这不适用于 IIS 6。当依赖于 MsDepSvc 时,是否有可以使用的等效参数?这是否可能,或者我是否只剩下自定义构建脚本或包构建,然后发布构建?

Here's what I want to do:

  1. Build an existing .csproj that targets "Package"
  2. Publish the package with MSDeploy to an IIS 6 server

This is for a TeamCity build and release that I'm trying to configure in a single step. I could create a custom build file but I'm trying to tackle this without adding any additional configurations to the app.

There are a lot of examples around of MSBuild parameters which can do this publishing via WMSVC - here's a great one - but that's not going to play ball with IIS 6. Are there equivalent params which can be used when there is a dependency on MsDepSvc? Is this even possible or am I left with either a custom build script or a package build followed by a publish build?

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

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

发布评论

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

评论(1

知你几分 2024-10-07 21:57:50

您可以修改现有的 .csproj 文件以添加所需的任何其他目标(它只是一个 MSBuild 文件),并且可以通过不同的 MSDeploy 提供程序(webServer60metaKey,或 contentPath 通过共享)。

虽然可以通过在项目的 MSBuild 中添加目标来实现这一点,但我建议您将这两个活动拆分为两个单独的目标。通过将它们拆分为两个单独的目标,您仍然可以将它们一起调用 msbuild /t:Package;Deploy,但您也可以单独调用它们。

这将允许您创建部署包并让 TeamCity 将其作为构建的工件包含在内。然后,您可以从 TeamCity 下载此包并将其独立部署到任何服务器,即使您是自动部署的。如果 TeamCity 还创建了您的发布版本,那么您就知道您已经有了生产部署

You can modify an existing .csproj file to add any additional target needed (it's just an MSBuild file) and publishing to an IIS6 server can be done via different MSDeploy providers (webServer60, metaKey, or contentPath via a share).

While this would be possible to do by adding a Target in the MSBuild of your project, I'd recommend that you split these two activities out into two separate targets. By splitting them into two separate targets you can still call them together msbuild /t:Package;Deploy but you can also call them independently.

This would allow you to create a deployment package and have TeamCity include it as an artifact of the build. You could then download this package from TeamCity and deploy it to any server independently, even if you deployed it automatically. If TeamCity also creates your release builds, you know have your production deployment

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