VS中的build events

执行多行命令,只能把命令写在一个批处理文件中,然后通过调用批处理来执行.

1.在Solution explorer中用context meun查看project的property.

2.选择Build Events,可以看到Pre-build 和Post-build event command line,以及运行Post-build event 的条件

//——————————————————

用法收集

1.build完后修改build产物的名字(后缀),并覆盖已有的同名文件.

copy $(TargetFileName) $(TargetName).XXX y

2. 调用外部命令或批处理:

call "C:\Program Files\XXX.exe"

3. 条件判断:

IF NOT $(ConfigurationName) == Release GOTO end

    call "C:\Program Files\XXX.exe" $(ProjectDir)$(TargetName).cvp

:end

4.web project 自动部署

copy     $(TargetDir)*.*     \\MyServer\MyService\bin
copy     $(ProjectDir)*.ascx     http://www.cnblogs.com/feishunji/admin/file:///MyService

5. copy from one path to the other path

Copy "$(ProjectDir)pri.bin" "$(SolutionDir)$(SolutionName)\$(OutDir)"

copy  pri.bin(file name) from $(ProjectDir) to $(SolutionDir)$(SolutionName)\$(OutDir)

 

引用自:http://hi.baidu.com/isafesoft/blog/item/e6be622531bf8109908f9d4d.html

posted @ 2011-03-09 17:32  Figo Fei  阅读(839)  评论(1编辑  收藏  举报