发布发布事件 [英] Post Publish Events

查看:34
本文介绍了发布发布事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于普通(例如 Windows 窗体)C# 应用程序,要在成功构建后执行命令,我将使用项目属性中的构建事件->构建后事件命令行.

For normal (say Windows Forms) C# applications, to execute commands after a successful build I would use the Build Events->Post-build event command line in Project Properties.

我使用解决方案资源管理器上下文菜单中的发布..."命令发布"了一个网站项目.

I have a Web Site project which I "Publish", using the "Publish..." command in the context menu in the solution explorer.

有没有办法在成功发布后运行命令,如果有的话是如何完成的?(例如发布后事件命令行字段)

Is there a way to run commands after the successful publish and if so how is it done? (eg a Post-Publish event command line field)

Visual Studio 2008,ASP .Net 网站项目,C#.

Visual Studio 2008, ASP .Net Web site project, C#.

推荐答案

更新: 由于 Publish Web 不适用于基于文件夹的网站项目,因此此答案假设您询问的是 Web 应用程序项目.

Update: Since Publish Web does not apply to folder-based web site projects, this answer assumes you are asking about a Web Application project.

您不能从 VS IDE 内部执行此操作.但是,您可以在记事本或您喜欢的 XML 编辑器中编辑您的项目文件,并在名为 AfterPublish 的文件末尾添加一个新目标.

You can't do this from inside the VS IDE. However, you can edit your project file in Notepad or your favorite XML editor and add a new target at the end of the file called AfterPublish.

如果您愿意,您可能想阅读更多关于 MSBuild 的内容不确定你能在这个目标中做什么.

You might want to read a bit more on MSBuild if you are not sure what you can do in this target.

您可以在 MSDN 上找到有关在 VS 中扩展构建过程的更多详细信息 - HowTo: 扩展 Visual Studio 构建过程.

You can find more details on extending the build process in VS at MSDN - HowTo: Extend the Visual Studio Build Process.

这篇关于发布发布事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆