In a Visual Studio pre-build event how do I execute an exe in the context of its own folder instead of the bin folder?

筅森魡賤 提交于 2019-12-10 00:58:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!