我有一个 .exe 程序,我需要在启动时在 docker 中运行它。我可以从容器的 powershell 运行它而不会出现任何错误,但不能从 powershell 脚本文件运行它。
- 容器名称:基础
- exe文件名:abc.exe
.exe 按预期运行,没有任何错误:
docker-compose ecex base powershell
PS C:\> abc.exe -someParam xyz
但是当我从 powershell 脚本文件中调用它时,它给了我以下错误:
runexe.ps1 文件:
# run
abc.exe -someParam xyz
错误 :
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.Form.ShowDialog(IWin32Window owner)
那么,我该如何克服这个问题呢?提前致谢。