我正在尝试使用Sequence Analyzer脚本在Azure DevOps中运行国家仪器TestStand Sequence Analyzer作为构建的一部分。代理正在作为服务运行。
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),并将类似的条目写入事件日志。
不需要用户交互:通常情况下,当分析完成时,对话框打开和关闭。我正在寻找它创建的退出代码和报告文件。有没有办法让它起作用呢?
发布于 2020-01-10 22:00:26
这可以通过以交互方式运行代理来实现,而不是作为服务。似乎交互式运行的唯一缺点是需要自动登录和相关的安全风险。有关服务与交互的更多信息,请访问here。
https://stackoverflow.com/questions/59680559
复制相似问题