问题描述
对于正常的(比如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.
我有一个网站项目,我发布,使用发布...命令,在Solution Explorer中的上下文菜单。
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#.
推荐答案
更新:由于发布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
.
您可能需要阅读多一点在如果你不知道你可以在这个目标去做。
You might want to read a bit more on MSBuild if you are not sure what you can do in this target.
您可以找到在MSDN中扩大VS生成过程的详细信息 - 。
You can find more details on extending the build process in VS at MSDN - HowTo: Extend the Visual Studio Build Process.
这篇关于帖子发布活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!