发布后事件
对于普通(例如 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新:由于发布 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.