Continuous integration 运行带有对话框的应用程序的Azure DevOps代理

Continuous integration 运行带有对话框的应用程序的Azure DevOps代理,continuous-integration,azure-devops-self-hosted-agent,teststand,Continuous Integration,Azure Devops Self Hosted Agent,Teststand,我正在尝试运行National Instruments TestStand,作为使用Python脚本在Azure DevOps中构建的一部分。代理正在作为服务运行 import subprocess command = '"%teststand%\Bin\AnalyzerApp.exe" MyAnalyzerProject.tsaproj /analyze /report /save /quit' exit_code = subprocess.call(command, shell=True)

我正在尝试运行National Instruments TestStand,作为使用Python脚本在Azure DevOps中构建的一部分。代理正在作为服务运行

import subprocess
command = '"%teststand%\Bin\AnalyzerApp.exe" MyAnalyzerProject.tsaproj /analyze /report /save /quit'
exit_code = subprocess.call(command, shell=True)
print(exit_code) # returns the exit status
当我手动运行它时,它工作,但当代理尝试运行它时失败:

Unhandled Exception: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
   at AnalyzerApp.e.a(String A_0, String A_1)
   at NationalInstruments.TestStand.Utility.LaunchTestStandApplicationInNewDomain.HandleLaunchProtectedException(Exception e, String applicationName, DisplayErrorMessageDelegate displayErrorMessage)
   at NationalInstruments.TestStand.Utility.LaunchTestStandApplicationInNewDomain.LaunchProtectedReturnCode(MainEntryPointDelegateWithArgsReturnCode entryPoint, String[] args, String applicationName, DisplayErrorMessageDelegate displayErrorMessage, Boolean parseArgs)
   at AnalyzerApp.e.b(String[] A_0)
我首先尝试使用cmd运行它,但根据代理服务用户的不同,它要么被卡住,要么抛出错误-532462766(0xE0434352),并将类似的条目写入事件日志


不需要用户交互:通常在分析完成时打开和关闭对话框。我在寻找它创建的退出代码和报告文件。有什么方法可以让它工作吗?

这可以通过交互运行代理而不是作为服务来实现。交互运行的唯一不利之处似乎是需要自动登录和相关的安全风险。
有关服务与互动的更多信息,请参见。

没错。托管代理也以交互方式运行。您还可以添加一个额外的构建阶段,并让它使用托管代理,以防您可以在其上安装交互式工具。