How to run a script\executable before start debugging in VS2015?

守給你的承諾、 提交于 2019-12-25 06:31:10

问题


I need to run a code generator before starting compilation\execution of my code in Visual Studio 2015.

Is there any way to add a script that will run my .bat.py file when I click "Start Local Debugger"?

I use UnrealEngine 4 and in my project there already are some .cs files that use precompilation scripts, but these scripts are not fired if the project is already up-to-date.

Any solutions?


回答1:


Open properties of your startup project in VS (should be your game, not UE4). You need Configuration Properties → Debugging.

When you click Local Windows Debugger (this is what it's labeled in my VS) it runs whatever is specified under Command with Command Arguments. UE4 projects usually have $(TargetPath) and "$(SolutionDir)$(ProjectName).uproject" specified but you can change it to run your .bat script and add custom logic.

However, if your project is not up to date, Build Command Line is going to be called before the debugger (Configuration Properties → NMake). For UE4 that would be UnrealEngine\Engine\Build\BatchFiles\Build.bat script. If you need your logic to run before Build.bat you can put it here. Or replace this script with your own.



来源:https://stackoverflow.com/questions/39266509/how-to-run-a-script-executable-before-start-debugging-in-vs2015

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