部署asp.net Web应用程序

时间:2011-09-08 16:32:56

标签: asp.net asp.net-mvc

我有ASP.NET MVC Web应用程序。我需要部署它包括: 1.更改一些Web.config部分 2.在Release配置下构建 3.复制到我的部署服务器(可选)

自动化此过程有哪些方法?

3 个答案:

答案 0 :(得分:2)

1. Changing some of Web.config sections

使用您可以通过修改Web项目中的Web.Debug.config和Web.Release.config来实现它的web.config transformation

2. Building under Release configuration
3. Copying to my deployment server (optional)

This post应该有所帮助。另请阅读有关发布内容的this

答案 1 :(得分:1)

我们使用Jenkins / Hudson的持续集成来构建并在其中部署一个任务,以便部署到在批处理脚本中使用msdeploy的登台或生产。

对于构建,msbuild for release版本的参数是:

/Target:Clean;Build /Property:Configuration=Release

确定msdeploy选项确实需要一段时间,但值得研究(如果您使用基于GUI的方法,Visual Studio正在幕后使用它进行部署)。

答案 2 :(得分:1)

在发布配置下构建&复制到部署服务器,您可以使用MS-Build和Team City / Team Build之类的工具来自动化该过程。

这是一篇很棒的文章,让您自己开始运作:How to use MSBuild to deploy an ASP.NET MVC application