Source: http://www.cnblogs.com/FreeDong/p/3406737.html
If Visual Studio is also used, the efficiency of the. NET program is greatly increased. This article is about Generating Events in Visual Studio. Right-click a project under solution and select "properties" to open the window to see the "generate events" option, which is not commonly used, I don't even touch it once after several years of writing code, but I need her today.
I have a solution named idletest, and the latest DLL is required for projects in another solution. The DLL generated in the original idletest is also in use for other projects, therefore, you need to copy the DLL generated by several projects in the idletest solution to a new directory. However, it is very troublesome to modify the claim each time, so we thought of generating an event. Baidu said that the command line in the event generation supports the doscommand, I tried to input"Copy [full source file path] Copy to path", It worked.
However, I need to copy the DLL generated by multiple projects to the new path, so that this "[full source file path]" is very troublesome and does not reflect reusability, is there a better way?
Open the macro in the generated event, as shown in
You can see that there is a list (containing "macro" and "value" columns ), the value of targetpath under Macro is the physical path of the DLL/EXE file generated by the current project. Double-click this row, "$ (targetpath)" appears in the box above.
Directly write down "post-event Generation Command Line" in the event generation window of each projectCopy $ (targetpath)E: \ projects \ mydemo \ joeylibs \ idletest \ DLLs ", andGenerate events after running"Select"Successful generation"Done.
I also use this function to do one thing, that is, when there are dozens of projects under the solution, I will use it in the last project generated (usually the ui or service, the operation is similar to the above, but the command is changed:
@ Echo msgbox "[$ (projectname)] generation completed! "> Msg. vbs @ msg. vbs @ del msg. vbs
Vs generate events