批处理文件来运行后发布 [英] Batch file to run after publish

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

问题描述

有没有使用发布选项后发布的Web应用程序,即后执行批处理文件的方法。

我已经阅读这里这表明以下几个其他问题:

1)AfterPublish属性添加到项目文件:

 <目标名称=CustomPostPublishActionsAfterTargets =MSDeployPublish>
    < Exec命令=回声后发布事件:主动配置是:$(ConfigurationName)/>
< /目标>

这似乎并没有工作。这是唯一到Visual Studio 2010相关的?

2)添加批处理文件位置到AfterBuild文本框,如下面的屏幕截图:

构建发布之前运行后因此这将无法工作。我怎样才能做到这一点在Visual Studio 2008?


解决方案

作为<一个href=\"http://stackoverflow.com/questions/776635/replicate-vs2008-publish-web-site-from-command-line\">this帖子状态:


  

下面的命令复制发布网站对话框,默认设置。


  
  

命令发布网站用默认设置

  aspnet_compiler -nologo -v / -pC:\\的WebSite1-uC:\\ TARGETPATH​​


所以你可以做如下:

1)看了上面的帖子,并尝试建立与编译一个bat文件/发布命令。

2)在该bat文件,编译/ publishin与previous命令后的网站,添加批处理命令要执行。

希望这有助于你

Is there a way to execute a batch file after publishing a web application i.e. after using the 'Publish' option.

I have read a few other questions on here which suggest the following:

1) Add AfterPublish attribute to the Project file:

<Target Name="CustomPostPublishActions" AfterTargets="MSDeployPublish" >
    <Exec Command="echo Post-PUBLISH event: Active configuration is: $(ConfigurationName)" />
</Target>

This does not seem to work. Is this only relevant to Visual Studio 2010?

2) Add the batch file location to the AfterBuild Text box as shown in the screenshot below:

After Build runs before the publish so this will not work. How can I do this in Visual Studio 2008?

解决方案

As this post states:

The following command duplicates the Publish Web Site dialog with default settings.

Command for Publish Web Site with Default Settings

aspnet_compiler -nologo -v / -p "C:\WebSite1" -u "C:\TargetPath"

So you can do as following:

1) Read the above post and try to build a bat file with the compilation/publish command.

2) Within that bat file, after compiling/publishin the website with the previous command, add the batch commands you want to execute.

Hope this helps you

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

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