首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用对话框运行应用程序的Azure DevOps代理

使用对话框运行应用程序的Azure DevOps代理
EN

Stack Overflow用户
提问于 2020-01-10 19:13:07
回答 1查看 230关注 0票数 2

我正在尝试使用Sequence Analyzer脚本在Azure DevOps中运行国家仪器TestStand Sequence Analyzer作为构建的一部分。代理正在作为服务运行。

代码语言:javascript
复制
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

当我手动运行它时,它可以工作,但当代理尝试运行它时,它会失败:

代码语言:javascript
复制
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),并将类似的条目写入事件日志。

不需要用户交互:通常情况下,当分析完成时,对话框打开和关闭。我正在寻找它创建的退出代码和报告文件。有没有办法让它起作用呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-01-10 22:00:26

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59680559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档