我应该使用什么工具来自动部署我的ASP。净MVC应用程序?

时间:2021-11-15 04:12:30

I've written a site for my summer internship using ASP.NET MVC. The progress is going well but one thing I have found painful is deployments. Particularly, because we have frequent deployments and I've been doing them by hand.

我用ASP写了一个暑期实习的网站。净MVC。进展很顺利,但有一件事我觉得很痛苦,那就是部署。特别是,因为我们有频繁的部署,我一直在用手工完成。

I'm looking for sort of the "standard" .NET deployment tool that can be utilized with an ASP.NET MVC project to automate our deployment process.

我正在寻找一种“标准”。net部署工具,可以使用ASP。NET MVC项目来自动化我们的部署过程。

Some things I would like the tool to be able to do (that I do manually now):

我希望工具能够做的一些事情(我现在手动):

  • Set compile mode to "Release"
  • 将编译模式设置为“Release”
  • Publish my ASP.NET MVC Web Application project
  • 发布我的ASP。NET MVC Web应用程序项目
  • Ensure debug mode = "Off" in my Web Config
  • 在我的Web配置中确保调试模式=“Off”
  • Change the connection strings for our database from dev db to prod db's info
  • 将数据库的连接字符串从dev db更改为prod db的信息
  • Transfer the Website to the web server
  • 将网站转移到web服务器
  • Ideally, it would be nice if it stopped the IIS site and replaced the existing site with the new files, then restarted it.
  • 理想的情况是,如果它停止IIS站点,并使用新文件替换现有站点,然后重新启动它,那就太好了。

Given sort of these soft requirements, what tool would you suggest I use to tackle this problem? I'm using II7 if it matters.

考虑到这些软需求,你建议我用什么工具来解决这个问题?我用的是II7。

4 个解决方案

#1


6  

I would use NAnt. You can have it:

我将使用NAnt。你可以有:

  • Retrieve the code from your source code repository (it has plug-ins for the vast majority of them).
  • 从源代码存储库中检索代码(其中大多数都有插件)。
  • It can compile the code either directly or use your solution file and command line options to start vstudio. Look at the command line options and you can tell it to do a rebuild and to change the mode to Release.
  • 它可以直接编译代码,也可以使用您的解决方案文件和命令行选项启动vstudio。查看命令行选项,您可以告诉它进行重新构建并将模式更改为Release。
  • It has XML commands (XMLPOKE) that will let you easily change the debug mode to off as part of the deployment
  • 它有XML命令(XMLPOKE),可以方便地将调试模式作为部署的一部分更改为off
  • Copying files is easy (it has lots of ways to do this).
  • 复制文件很容易(有很多方法可以做到这一点)。

And, you don't need to stop the IIS site. You can simply add an app_offline.htm file (double-check my file name). When the site is hit, this page will automatically display. So have the NAnt script deploy the file as it's first step and remove it as it's last step.

而且,您不需要停止IIS站点。您可以简单地添加app_offline。htm文件(双击我的文件名)。当点击该站点时,该页面将自动显示。因此,让NAnt将文件部署为第一步,并将其删除为最后一步。

#2


2  

This is only supported until VS2010

这只支持到VS2010

Check out the Web Deployment Project. It is able to do most of what you request. I used it for the building part of deployment. I am not shure about the copying to iis and restart IIS-part.

查看Web部署项目。它能做你要求的大部分事情。我将它用于部署的构建部分。我不害怕复制到iis并重新启动is部分。

#3


1  

Have you taken a look at WebDeploy yet?

你看过WebDeploy吗?

#4


0  

You can try InstallAce that takes care of most of deployment scenarios of Web Applications including build packaging, Scripting tasks, IIS or SQL tasks, file distribution and server side config files updation.

您可以尝试使用InstallAce来处理Web应用程序的大多数部署场景,包括构建打包、脚本任务、IIS或SQL任务、文件分发和服务器端配置文件升级。

#1


6  

I would use NAnt. You can have it:

我将使用NAnt。你可以有:

  • Retrieve the code from your source code repository (it has plug-ins for the vast majority of them).
  • 从源代码存储库中检索代码(其中大多数都有插件)。
  • It can compile the code either directly or use your solution file and command line options to start vstudio. Look at the command line options and you can tell it to do a rebuild and to change the mode to Release.
  • 它可以直接编译代码,也可以使用您的解决方案文件和命令行选项启动vstudio。查看命令行选项,您可以告诉它进行重新构建并将模式更改为Release。
  • It has XML commands (XMLPOKE) that will let you easily change the debug mode to off as part of the deployment
  • 它有XML命令(XMLPOKE),可以方便地将调试模式作为部署的一部分更改为off
  • Copying files is easy (it has lots of ways to do this).
  • 复制文件很容易(有很多方法可以做到这一点)。

And, you don't need to stop the IIS site. You can simply add an app_offline.htm file (double-check my file name). When the site is hit, this page will automatically display. So have the NAnt script deploy the file as it's first step and remove it as it's last step.

而且,您不需要停止IIS站点。您可以简单地添加app_offline。htm文件(双击我的文件名)。当点击该站点时,该页面将自动显示。因此,让NAnt将文件部署为第一步,并将其删除为最后一步。

#2


2  

This is only supported until VS2010

这只支持到VS2010

Check out the Web Deployment Project. It is able to do most of what you request. I used it for the building part of deployment. I am not shure about the copying to iis and restart IIS-part.

查看Web部署项目。它能做你要求的大部分事情。我将它用于部署的构建部分。我不害怕复制到iis并重新启动is部分。

#3


1  

Have you taken a look at WebDeploy yet?

你看过WebDeploy吗?

#4


0  

You can try InstallAce that takes care of most of deployment scenarios of Web Applications including build packaging, Scripting tasks, IIS or SQL tasks, file distribution and server side config files updation.

您可以尝试使用InstallAce来处理Web应用程序的大多数部署场景,包括构建打包、脚本任务、IIS或SQL任务、文件分发和服务器端配置文件升级。