Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 在生成前或生成后事件-Visual Studio中请求用户输入_Visual Studio_User Input_Post Build Event_Pre Build Event_Build Events - Fatal编程技术网

Visual studio 在生成前或生成后事件-Visual Studio中请求用户输入

Visual studio 在生成前或生成后事件-Visual Studio中请求用户输入,visual-studio,user-input,post-build-event,pre-build-event,build-events,Visual Studio,User Input,Post Build Event,Pre Build Event,Build Events,我希望用户通过请求用户输入(如“y”或“n”)来批准生成前或生成后事件中的操作。因此,例如,如果用户错误地忘记切换配置,则可以取消任务 if $(ConfigurationName) == Release ( //ask user to type in some text ) 有人能给我举个例子吗?不幸的是,我什么也找不到。如果可能,我希望避免调用另一个批处理文件。 提前Thx。使用“启动/等待”在生成事件命令窗口中启动命令 例如: start /wait powershell.exe

我希望用户通过请求用户输入(如“y”或“n”)来批准生成前或生成后事件中的操作。因此,例如,如果用户错误地忘记切换配置,则可以取消任务

if $(ConfigurationName) == Release (
   //ask user to type in some text
)
有人能给我举个例子吗?不幸的是,我什么也找不到。如果可能,我希望避免调用另一个批处理文件。
提前Thx。

使用“启动/等待”在生成事件命令窗口中启动命令

例如:

start /wait powershell.exe -file $(ProjectDir)\UpdateAssemblyVersion.ps1 -configuration $(ConfigurationName)

然后,您可以使用Read Host请求用户输入。

您找到解决方案了吗?很遗憾,没有