gpt4 book ai didi

c# - System.ComponentModel.Win32Exception (0x80004005) : No such interface supported

转载 作者:太空狗 更新时间:2023-10-30 00:31:15 24 4
gpt4 key购买 nike

Windows 服务启动的程序出现问题。

流程是

  • exe 启动
  • 将自己重命名为 *.bak
  • 自己下载最新版本
  • 调用Restart()
  • 执行大量文件和 SQL 操作(更新我们的主要软件套件)
  • 然后调用 Restart()
  • 流程再次开始。如果主套件没有软件更新,它不会重新启动

除一个客户站点外,这一切都完美无缺

在一个网站上,第一个 Restart() 有效,但第二个总是抛出异常。

System.ComponentModel.Win32Exception (0x80004005): No such interface supported at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at UpdateCompanionService.Program.Restart()

它是一个WS2008标准的服务器。

public static void Restart()
{
try
{
var procPath = Path.Combine(Config.UpdateCompanionDirectory, "UpdateCompanionService.exe");
Logger.Debug("Starting procecss {0}", procPath);

var proc = new Process
{
StartInfo = {FileName = procPath, WorkingDirectory = Config.UpdateCompanionDirectory, Arguments = "/noupdate", UseShellExecute = true}
};

proc.Start();
Environment.Exit(-1);
}
catch (Exception e)
{
Logger.Fatal("Error restarting update companion", e);
}
}

最佳答案

尝试使用

    UseShellExecute = false 

已知可以解决此问题

关于c# - System.ComponentModel.Win32Exception (0x80004005) : No such interface supported,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28469809/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com