在Visual Studio预构建事件中,如何在其自己的文件夹而不是bin文件夹的上下文中执行exe? [英] 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?
本文介绍了在Visual Studio预构建事件中,如何在其自己的文件夹而不是bin文件夹的上下文中执行exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个如下定义的预构建事件:
I have a pre-build event defined like this:
$(ProjectDir)PreBuild\runthis.exe
当runthis.exe执行时,它将在我项目的bin文件夹的上下文中运行,而不是它所在的PreBuild文件夹.如何使构建事件在PreBuild文件夹而不是bin文件夹的上下文中执行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?
推荐答案
首先添加cd $(ProjectDir)PreBuild
以切换到该文件夹.
Add cd $(ProjectDir)PreBuild
first to switch to that folder.
这篇关于在Visual Studio预构建事件中,如何在其自己的文件夹而不是bin文件夹的上下文中执行exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文