使用 NAnt 发布 WebApplication
是否可以使用 NAnt 在解决方案上完成发布(如在 Visual Studio 中在 Web 应用程序项目上发布)? 我只是找不到解决方案。
Is it possible to accomplish publish (as in Visual Studio publish on Web Application project) on solution using NAnt? I just can't find the solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
它们的关键是使用内置的“_CopyWebApplication”目标。
这是我
对以下目录结构所做的操作:
编辑:我还使用它来使用 YUI 压缩来压缩我的 css 和 js
They key is to use the built-in "_CopyWebApplication" target.
Here is what i do
with the dir structure of:
Edit: i also use this to use the YUI compression to compress my css and js
使用 MSBuild 胜过了使用 NAnt 的目的,NAnt 是替代 MSBuild 的东西,使用下面的代码对 Web 应用程序项目进行干净的 NAnt 编译,就像在 VS 2003/2005/2008 中一样。
这个对我有用!
Using MSBuild beats the purpose of using NAnt, NAnt is something that replaces MSBuild, use the below to do a clean NAnt compilation of Web Application Projects as in VS 2003/2005/2008.
It works for me!
我知道这是一个老问题,但我刚刚学到了一些东西,所以我决定分享:虽然“_CopyWebApplication”目标存在并工作是 100% 真实的,但从 .NET 4.0 开始,它已被“ Microsoft.Web.Publishing.targets 中的“_WPPCopyWebApplication”目标,它支持 web.config 转换语法等新功能
(重新发布到所有类似措辞的问题,所以不要投票给这个:))
I know this is an old question, but I just learned something, so I decided I'd share: While it is 100% true that the "_CopyWebApplication" target exists and works, as of .NET 4.0 it has been superseded by the "_WPPCopyWebApplication" target in Microsoft.Web.Publishing.targets, which supports new features like web.config transformation syntax, etc.
(reposting to all the similarly worded questions, so don't vote for this one :) )
以下是使用 nant 的 MSBUILD 任务执行此操作的方法:
这会将 WebApplication 编译到可部署的文件夹中,就像使用 Visual Studio 中的“发布”功能一样。
Here is how you can do it using the MSBUILD task for nant:
This will compile the WebApplication into a deployable folder, just like using the "Publish" feature from within Visual Studio.