0
我试图启动和终止从Windows service.Here我的WPF应用程序,我用什么来启动应用程序杀的过程:如何启动和从一个窗口服务
Process.Start("MyApplicationName");
它给了我下面的例外的位置:
> The system cannot find the file specified;; at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
虽然查杀过程中它给了我下面的异常
> The system cannot find the file specified;; at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at SSMScoreboardService.Service1.Scoreboard(String status)
虽然同一段代码与Winform应用程序完美协作。
您遇到的异常可能是由于权限不足造成的。您的目标流程是否设计为在服务环境中运行? –
@indeterminatelysequenced不,如何做到这一点?而关于特权相同的东西在winform应用程序中运行完美 –
您是否提供了可执行文件的完整路径? –