简体   繁体   English

部署 ASP.Net Web 应用程序的好方法是什么?

[英]What could be good ways to deploy ASP.Net Web Applications?

We currently deploy web applications by creating a database and running SQL scripts through query analyzer.我们目前通过创建数据库并通过查询分析器运行 SQL 脚本来部署 web 应用程序。 Then we copy the output from "publish website" and set up that website in IIS.然后我们从“发布网站”复制 output 并在 IIS 中设置该网站。

We have seen websetup in visual studio, but that part seems to be thinly documented.我们已经在 Visual Studio 中看到了 websetup,但该部分似乎没有什么文档。 For example, we are not clear how to ask the user for IP and password of SQL server.例如,我们不清楚如何向用户询问 IP 和 SQL 服务器的密码。 We also tend to get websites deployed this way coming up under folders like http://example.com/project , instead of just http://example.com .我们还倾向于以这种方式部署的网站出现在http://example.com/project之类的文件夹下,而不仅仅是http://example.com

Then there are issues with AJAX.Net not being installed or some or the other patch not applied.然后存在未安装 AJAX.Net 或未应用某些或其他补丁的问题。

So far, we have physical access to the servers.到目前为止,我们可以物理访问服务器。 Pretty soon though we are going to be shipping CDROMs.很快,虽然我们将要运送 CDROM。 What is the practical tradeoff between manual intervention and automation?人工干预和自动化之间的实际权衡是什么?

Avoid Visual Studio deployment, and automate as much as possible.避免 Visual Studio 部署,并尽可能自动化。 Web Deployment Projects and NAnt can be your friends! Web部署项目和NAnt可以成为你的朋友!

Briefly, our deployment setup:简而言之,我们的部署设置:

  1. We use RedGate SQL to script differences between dev and live database.我们使用 RedGate SQL 编写开发数据库和实时数据库之间的差异脚本。

  2. 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. 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.

  3. On the server side, there is another NAnt build file which takes the application offline, backs up the database, backs up the website.在服务器端,还有另一个 NAnt 构建文件,它使应用程序脱机、备份数据库、备份网站。 runs the SQL change script, unzips the new version and brings the app online.运行 SQL 更改脚本,解压缩新版本并使应用程序上线。

Step 3 is usually run "manually" (one double-click), but sometimes scheduled for late at night.第 3 步通常是“手动”运行(双击),但有时会安排在深夜。 You could do exactly the same from a CDROM, or even write a pretty little Windows Forms app as a wrapper.您可以从 CDROM 执行完全相同的操作,甚至可以编写一个非常小的 Windows Forms 应用程序作为包装器。

Quite happy to give details of the NAnt script if you're interested.如果您有兴趣,很乐意提供 NAnt 脚本的详细信息。

Have you tried using Web Deployment project?您是否尝试过使用Web 部署项目? There is support for VS 2008 also now..现在也支持VS 2008 ..

I deploy mostly ASP.NET apps to Linux servers.我主要将 ASP.NET 应用程序部署到 Linux 服务器。 Here is my standard workflow:这是我的标准工作流程:

  • I use a source code repository (like Subversion)我使用源代码存储库(如 Subversion)
  • On the server, I have a bash script that does the following:在服务器上,我有一个 bash 脚本,它执行以下操作:
    • Checks out the latest code查看最新代码
    • Does a build (creates the DLLs)进行构建(创建 DLL)
    • Filters the files down to the essentials (removes code files for example)将文件过滤到基本要素(例如删除代码文件)
    • Backs up the database备份数据库
    • Deploys the files to the web server in a directory named with the current date将文件部署到以当前日期命名的目录中的 web 服务器
    • Updates the database if a new schema is included in the deployment如果部署中包含新架构,则更新数据库
    • Makes the new installation the default one so it will be served with the next hit使新安装成为默认安装,以便下次命中时提供

Checkout is done with the command-line version of Subversion and building is done with xbuild (msbuild work-alike from the Mono project).使用 Subversion 的命令行版本完成检查,并使用 xbuild 完成构建(msbuild 与 Mono 项目类似)。 Most of the magic is done in ReleaseIt.大多数魔法都是在 ReleaseIt 中完成的。

On my dev server I essentially have continuous integration but on the production side I actually SSH into the server and initiate the deployment manually by running the script.在我的开发服务器上,我基本上进行了持续集成,但在生产方面,我实际上将 SSH 放入服务器并通过运行脚本手动启动部署。 My script is cleverly called 'deploy' so that is what I type at the bash prompt.我的脚本被巧妙地称为“部署”,这就是我在 bash 提示符下键入的内容。 I am very creative.我很有创意。 Not.不是。

In production, I have to type 'deploy' twice: once to check-out, build, and deploy to a dated directory and once to make that directory the default instance.在生产环境中,我必须输入“deploy”两次:一次是签出、构建和部署到一个过时的目录,一次是将该目录设置为默认实例。 Since the directories are dated, I can revert to any previous deployment simply by typing 'deploy' from within the relevant directory.由于目录已过时,我只需在相关目录中键入“deploy”即可恢复到任何以前的部署。

Initial deployment takes a couple of minutes and reversion to a prior version takes a few seconds.初始部署需要几分钟,恢复到以前的版本需要几秒钟。

It has been a nice solution for me and relies only on the three command-line utilities (svn, xbuild, and releaseit), the DB client, SSH, and Bash.它对我来说是一个很好的解决方案,它只依赖于三个命令行实用程序(svn、xbuild 和 releaseit)、DB 客户端、SSH 和 Bash。

I really need to update the copy of ReleaseIt on CodePlex sometime:我真的需要有时在 CodePlex 上更新 ReleaseIt 的副本:

http://releaseit.codeplex.com/ http://releaseit.codeplex.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将ASP.NET MVC应用程序部署到IIS的好方法是什么? - What is a good way to deploy ASP.NET MVC applications to IIS? 什么是SQL Server for ASP.NET应用程序的一个很好的替代品? - What is a good alternative to SQL Server for ASP.NET applications? ASP.NET Web应用程序 - Asp.net web applications 与StackOverflow一样的其他ASP.NET Web应用程序是什么? - What are other ASP.NET web applications that are as well done as StackOverflow? ASP.NET Web应用程序中的常量的一些示例或用法是什么? - What are some examples or uses of constants in ASP.NET web applications? 什么是了解ASP.NET中的web.config的好资源? - What is a good resource for understanding web.config in asp.net? 良好的设计和良好的用户界面ASP.NET Ajax应用程序? - Good design and good user interface ASP.NET Ajax applications? 有人创建安装程序来部署内部asp.net Web应用程序吗? - Does anybody create installers to deploy internal asp.net web applications? 我们可以像软件一样在客户端计算机上部署ASP.Net Web应用程序吗? - Can we deploy ASP.Net Web Applications on a Client Computer like a Software? 收集ASP.NET应用程序性能计数器数据的首选方法 - Preferred ways to collect performance counters data for ASP.NET applications
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM