首页 > 解决方案 > 通过 Shell 运行时,Visual Studio 编译器不退出(返回值 STILL_ACTIVE)

问题描述

我通过 Shell 启动编译器,如下所示:

lProcID = Shell("cmd /C devenv /clean RELEASE d:\examplesolution.sln", SW_HIDE)
lProcHnd = OpenProcess(PROCESS_QUERY_INFORMATION, True, lProcID)

Dim lret&
lret = STILL_ACTIVE

Do
    GetExitCodeProcess lProcHnd, lret  'ShellExecuteWithExitCodeEx
Loop While lret = STILL_ACTIVE

由于某种原因,它不会退出。

lRet 始终为 259(“STILL_ACTIVE”)。

这可能是什么原因?

如果我通过 x86 Native Tools Command Fromt for VS 2019 运行相同的命令,它工作正常:

在此处输入图像描述

标签: visual-studiovs-community-edition

解决方案


推荐阅读