发布后事件

发布于 2024-08-03 22:58:36 字数 232 浏览 6 评论 0原文

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

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

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

Visual Studio 2008、ASP .Net 网站项目、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 Web site project, C#.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫弦 2024-08-10 22:58:36

更新:由于发布 Web 不适用于基于文件夹的网站项目,因此此答案假设您正在询问 Web 应用程序项目。

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

如果您不确定,您可能需要阅读更多有关 MSBuild 的内容你可以在这个目标上做什么。

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

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

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.

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文