什么是部署 ASP.Net Web 应用程序的好方法? [英] What could be good ways to deploy ASP.Net Web Applications?

查看:20
本文介绍了什么是部署 ASP.Net Web 应用程序的好方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前通过创建数据库并通过查询分析器运行 SQL 脚本来部署 Web 应用程序.然后我们复制发布网站"的输出并在 IIS 中设置该网站.

We currently deploy web applications by creating a database and running SQL scripts through query analyzer. Then we copy the output from "publish website" and set up that website in IIS.

我们已经在 Visual Studio 中看到了 websetup,但是这部分的文档似乎很少.例如,我们不清楚如何向用户询问 SQL 服务器的 IP 和密码.我们也倾向于让网站以这种方式部署在 http://example.com/project 等文件夹下,而不是只是http://example.com.

We have seen websetup in visual studio, but that part seems to be thinly documented. For example, we are not clear how to ask the user for IP and password of SQL server. We also tend to get websites deployed this way coming up under folders like http://example.com/project, instead of just http://example.com.

然后是未安装 AJAX.Net 或未应用某些或其他补丁的问题.

Then there are issues with AJAX.Net not being installed or some or the other patch not applied.

到目前为止,我们可以物理访问服务器.很快,尽管我们将运送 CDROM.手动干预和自动化之间的实际权衡是什么?

So far, we have physical access to the servers. Pretty soon though we are going to be shipping CDROMs. What is the practical tradeoff between manual intervention and automation?

推荐答案

避免 Visual Studio 部署,并尽可能实现自动化.Web 部署项目和 NAnt 可以成为您的朋友!

Avoid Visual Studio deployment, and automate as much as possible. Web Deployment Projects and NAnt can be your friends!

简而言之,我们的部署设置:

Briefly, our deployment setup:

  1. 我们使用 RedGate SQL 来编写开发数据库和实时数据库之间的差异.

  1. We use RedGate SQL to script differences between dev and live database.

一个调用 MSBUILD 来构建 Web 部署项目 (.wdproj) 的 NAnt 构建文件,压缩生成的已编译 Web 应用程序(连同 SQL 更改脚本),然后将 zip 文件上传到服务器.

An NAnt build file which calls MSBUILD to build the web deployment project (.wdproj), zips up the resulting compiled web app (along with the SQL change script) and then uploads the zip file to the server.

在服务器端,还有另一个 NAnt 构建文件,它使应用程序脱机、备份数据库、备份网站.运行 SQL 更改脚本,解压缩新版本并使应用程序联机.

On the server side, there is another NAnt build file which takes the application offline, backs up the database, backs up the website. runs the SQL change script, unzips the new version and brings the app online.

第 3 步通常是手动"运行(双击),但有时会安排在深夜.您可以从 CDROM 执行完全相同的操作,甚至可以编写一个非常小的 Windows 窗体应用程序作为包装器.

Step 3 is usually run "manually" (one double-click), but sometimes scheduled for late at night. You could do exactly the same from a CDROM, or even write a pretty little Windows Forms app as a wrapper.

如果您有兴趣,很高兴提供 NAnt 脚本的详细信息.

Quite happy to give details of the NAnt script if you're interested.

这篇关于什么是部署 ASP.Net Web 应用程序的好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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