如何将 ASP.NET 应用程序部署到实时服务器? [英] How do you deploy your ASP.NET applications to live servers?

查看:28
本文介绍了如何将 ASP.NET 应用程序部署到实时服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找用于将 ASP.NET Web 应用程序项目(不是 ASP.NET 网站)部署到生产环境的不同技术/工具?

I am looking for different techniques/tools you use to deploy an ASP.NET web application project (NOT ASP.NET web site) to production?

我对持续集成构建服务器在某个位置放置二进制文件和第一个用户请求命中这些二进制文件之间发生的工作流特别感兴趣.

I am particularly interested of the workflow happening between the time your Continuous Integration Build server drops the binaries at some location and the time the first user request hits these binaries.

  1. 您使用的是某些特定工具还是仅使用 XCOPY?应用程序是如何打包的(ZIP、MSI、...)?

  1. Are you using some specific tools or just XCOPY? How is the application packaged (ZIP, MSI, ...)?

首次部署应用程序时,您如何设置应用程序池和虚拟目录(您是手动创建还是使用某种工具创建它们)?

When an application is deployed for the first time how do you setup the App Pool and Virtual Directory (do you create them manually or with some tool)?

当静态资源(CSS、JS 或图像文件)发生变化时,您是重新部署整个应用程序还是仅重新部署修改后的资源?当程序集/ASPX 页面更改时如何?

When a static resource changes (CSS, JS or image file) do you redeploy the whole application or only the modified resource? How about when an assembly/ASPX page changes?

您是否跟踪给定应用程序的所有已部署版本?如果出现问题,您是否有将应用程序恢复到先前已知工作状态的程序?

Do you keep track of all deployed versions for a given application and in case something goes wrong do you have procedures of restoring the application to a previous known working state?

请随意完成之前的列表.

Feel free to complete the previous list.

以下是我们用于部署 ASP.NET 应用程序的内容:

And here's what we use to deploy our ASP.NET applications:

  1. 我们添加了一个 Web部署项目到解决方案并设置它以构建 ASP.NET Web 应用程序
  2. 我们向解决方案添加一个设置项目(NOT Web 设置项目)并将其设置为获取 Web 部署项目的输出
  3. 我们添加自定义安装操作,并在 OnInstall 事件中运行自定义构建 .NET 程序集,该程序集使用 System.DirectoryServices.DirectoryEntry(此任务仅在第一次部署应用程序时执行).我们支持 IIS 中的多个网站、虚拟目录的身份验证以及应用程序池的身份设置.
  4. 我们在 TFS 中添加了一个自定义任务来构建安装项目(TFS 不支持安装项目,因此我们不得不使用 devenv.exe 来构建 MSI)
  5. MSI 安装在实时服务器上(如果有以前版本的 MSI,则首先将其卸载)
  1. We add a Web Deployment Project to the solution and set it up to build the ASP.NET web application
  2. We add a Setup Project (NOT Web Setup Project) to the solution and set it to take the output of the Web Deployment Project
  3. We add a custom install action and in the OnInstall event we run a custom build .NET assembly that creates an App Pool and a Virtual Directory in IIS using System.DirectoryServices.DirectoryEntry (This task is performed only the first time an application is deployed). We support multiple Web Sites in IIS, Authentication for Virtual Directories and setting identities for App Pools.
  4. We add a custom task in TFS to build the Setup Project (TFS does not support Setup Projects so we had to use devenv.exe to build the MSI)
  5. The MSI is installed on the live server (if there's a previous version of the MSI it is first uninstalled)

推荐答案

我们使用 Setup Factory 将所有代码部署在 MSI 中.如果必须更改某些内容,我们将重新部署整个解决方案.这对于 css 文件来说听起来有点矫枉过正,但它绝对让所有环境保持同步,而且我们确切地知道生产中的内容(我们以相同的方式部署到所有测试和 uat 环境).

We have all of our code deployed in MSIs using Setup Factory. If something has to change we redeploy the entire solution. This sounds like overkill for a css file, but it absolutely keeps all environments in sync, and we know exactly what is in production (we deploy to all test and uat environments the same way).

这篇关于如何将 ASP.NET 应用程序部署到实时服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆