Post-build event, post-event
Ref: http://blog.csdn.net/teng_ontheway/article/details/8307410
Ref: http://blog.csdn.net/sodickbird/article/details/4826068
Requirement:
Requirement: Maybe we need to release a version for the artist. Then we need to put *. exe, *. dll and resources in a folder and synchronize them to the artist.
Problem:The directory generated by Wait .exe may be inconsistent with the Resource Directory during the generation project., Cannot always be compiled onceManualCopy the generated .exe and dll to the Resource Directory.
Solution: Use the post-generation batch processing command that comes with visual studio
Visual studio-> right-click the project-> properties-> Build Events-> Post-Build Event-> Command Line
Xcopy $ (OutDir) $ (TargetFileName) $ (ProjectDir) .. \ Resources \/Y
This command is used to copy the exe files under the generated directory to the Resources folder under the upper-level directory of the project directory.
Notes:
1. $ (OutDir) and other macro paths are included '\'
2. After the event is generated, xcopy actually runs a console command, so the command does not support '/'
Like a previously written error command
Xcopy $ (OutDir) $ (TargetFileName) $ (ProjectDir) ../Resources \/Y
An error is prompted during running.
3. "/Y" is a parameter, indicating that if the same file exists, it will be replaced.
You can also copy the entire folder.
Xcopy "$ (ProjectDir) controls" $ (TargetDir) .. \ app1 \ controls "/y/I/e/exclude: CodeFilesToExclude.txt
For specific parameters, refer to the CMD console to view specific xcopy functions...
Bin Folders
Each project shocould write their output toBinFolder under each ofDev Folders.BinShocould NOT be checked into TFS, but shocould be created via a post-build event or by changing the project's output path.
If post-build events are used, the following is a sample which assumes the solution in the root directory:
@ Echo if not exist "$ (SolutionDir) Cloud \ bin \" (mkdir "$ (SolutionDir) Cloud \ bin \")
If not exist "$ (SolutionDir) Cloud \ bin \" (mkdir "$ (SolutionDir) Cloud \ bin \")
@ Echo copy/Y "$ (TargetDir) $ (TargetName). *" $ (SolutionDir) Cloud \ bin \"
Copy/Y "$ (TargetDir) $ (TargetName). *" $ (SolutionDir) Cloud \ bin \"
Note: Make sure youEchoStatements beforeyou execute them. This can help in debugging post-build failures in build logfiles.