如何使用 MSBuild 发布 Asp.NET Web 应用程序?

编程入门 行业动态 更新时间:2024-10-20 11:50:39
本文介绍了如何使用 MSBuild 发布 Asp.NET Web 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用 NAnt 和 MSBuild 在本地发布一个 Asp MVC Web 应用程序.这就是我用于我的 NAnt 目标的东西;

I am trying to publish an Asp MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target;

<target name="publish-artifacts-to-build"> <msbuild project="my-solution.sln" target="Publish"> <property name="Configuration" value="debug" /> <property name="OutDir" value="builds" /> <arg line="/m:2 /tv:3.5" /> </msbuild> </target>

我得到的只是作为回应;

and all I get is this as a response;

[msbuild] Skipping unpublishable project.

是否可以通过这种方式通过命令行发布 Web 应用程序?

Is it possible to publish web applications via the command line in this way?

推荐答案

您尝试调用的发布"目标是用于OneClick"部署,而不是用于发布网站...这就是为什么您得到看似奇怪的消息.您可能希望使用 AspNetCompiler 任务,而不是 MSBuild 任务.请参阅 msdn2.microsoft/en-us/library/ms164291.aspx 有关此任务的更多信息.您的PublishDir"将对应于任务的 TargetPath 属性.

The "Publish" target you are trying to invoke is for "OneClick" deployment, not for publishing a website... This is why you are getting the seemingly bizarre message. You would want to use the AspNetCompiler task, rather than the MSBuild task. See msdn2.microsoft/en-us/library/ms164291.aspx for more info on this task. Your "PublishDir" would correspond to the TargetPath property of the task.

来源

更多推荐

如何使用 MSBuild 发布 Asp.NET Web 应用程序?

本文发布于:2023-06-03 10:07:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/473781.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   应用程序   MSBuild   Asp   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!