如何包括所有部署文件

如何包括所有部署文件

本文介绍了ASP.NET Web应用程序构建输出 - 如何包括所有部署文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我构建我的网络应用程序时,我得到一个.dll文件与它的网站的代码(这是伟大的),但网站也需要所有的.aspx文件和朋友,这些需要放在正确的目录结构。作为每个构建的结果,我如何将它全部放在一个目录中?尝试从源目录中选择正确的文件是一种痛苦。

When I build my ASP.NET web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as the result of each build? Trying to pick the right files out of the source directory is a pain.

最终结果应为xcopy可部署。

The end result should be xcopy deployable.

更新:我不想手动使用我所知道的发布命令。我想要应用程序所需的完整文件集作为构建输出 - 这意味着我也可以从一个地方得到一整套文件,方法是运行。

Update: I don't want to have to manually use the Publish command which I'm aware of. I want the full set of files required by the application to be the build output - this means I also get the full set of files in one place from running MSBuild.

推荐答案

一个解决方案似乎是Web部署项目(WDP) ,可用于Visual Studio(和msbuild)的附件,可将Web项目构建到目录中,并可选择合并程序集并更改web.config文件。构建WDP的输出是在一个目录中部署站点所需的所有文件。

One solution appears to be Web Deployment Projects (WDPs), an add-on for Visual Studio (and msbuild) available that builds a web project to a directory and can optionally merge assemblies and alter the web.config file. The output of building a WDP is all the files necessary to deploy the site in one directory.

有关Web部署项目的更多信息:

More information about Web Deployment Projects:


  1. 的公告


  1. Announcement on webdevtools MSDN blog for WDP 2008
  2. ScottGu introduction to WDP 2005

此解决方案的唯一缺点是需要在构建机器上必须可用的附加组件。不过现在还够好了!

The only disadvantage to this solution is the requirement on an add-on which must be available on the build machine. Still, it's good enough for now!

这篇关于ASP.NET Web应用程序构建输出 - 如何包括所有部署文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 07:40