问题
I have a pre-build event defined like this:
$(ProjectDir)PreBuild\runthis.exe
When the runthis.exe executes, it runs in the context of the bin folder of my project instead of the PreBuild folder where it lives. How can I make the build event execute runthis.exe in the context of the PreBuild folder instead of the bin folder?
回答1:
Add cd $(ProjectDir)PreBuild
first to switch to that folder.
来源:https://stackoverflow.com/questions/13767157/in-a-visual-studio-pre-build-event-how-do-i-execute-an-exe-in-the-context-of-its