在VS2015中开始调试之前,如何运行脚本\可执行文件? [英] How to run a script\executable before start debugging in VS2015?

查看:603
本文介绍了在VS2015中开始调试之前,如何运行脚本\可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2015中开始编译\执行我的代码之前,我需要运行代码生成器。

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

有什么方法可以添加将运行的脚本当我单击启动本地调试器时,我的.bat.py文件是什么?

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

我使用UnrealEngine 4,并且在我的项目中已经有一些 .cs 使用预编译脚本的文件,但是如果项目已经是最新的,则不会触发这些脚本。

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.

任何解决方案?

推荐答案

在VS中打开启动项目的属性(应该是您的游戏,而不是UE4)。您需要配置属性→调试

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

单击本地Windows调试器(这是我的VS中标记的名称)时,它将运行指定的内容在 Command 下并带有 Command Arguments 。 UE4项目通常已指定 $(TargetPath) $(SolutionDir)$(ProjectName).uproject ,但您可以对其进行更改以运行.bat脚本并添加自定义逻辑。

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.

但是,如果您的项目不是最新的,则将在调试器之前调用构建命令行(配置属性→NMake >)。对于UE4,这将是 UnrealEngine\Engine\Build\BatchFiles\Build.bat 脚本。如果您需要在Build.bat之前运行逻辑,则可以将其放在此处。或用您自己的脚本替换此脚本。

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.

这篇关于在VS2015中开始调试之前,如何运行脚本\可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆