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

2

Having an issue with a program that is launched by a windows service.

The process flow is

  • exe launches
  • renames itself to *.bak
  • downloads the latest version of itself
  • calls Restart()
  • does a bunch of file and SQL operations (updating our main software suite)
  • then calls Restart()
  • Process flow starts again. IF there were no software updates for the main suite it does not restart

this all works perfect except for one customer site

On one site, the first Restart() works, but the second one always throws an exception.

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

It is a WS2008 standard server.

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);
  }
}
c#
.net
process
windows-server-2008
asked on Stack Overflow Feb 12, 2015 by TheRealTy

3 Answers

2

Try using

    UseShellExecute = false 

Its been known to fix this problem

answered on Stack Overflow Feb 14, 2015 by BoldAsLove
0

You can try to set UseShellExecute = false in your code.

I remember some own problems long ago, where I even recompiled the original .NET framework code to find out that setting this flags uses a completely different method of starting.

For me it seems you do not need UseShellExecute = true in your case.

If this does not work, you should check security context / GPO settings, e.g. "Is this service running as SYSTEM or (domain) user ?"

Also be sure that your new EXE with all additional components is "ready" at the time where you try to restart it (maybe you use a background thread which did not complete).

answered on Stack Overflow Feb 12, 2015 by Rainer Schaack
0

I had similar issue with an executable which is called by a Web Application running on IIS. In my case the solution was to restart the Application Pool for to current Web Application.

answered on Stack Overflow Jul 11, 2018 by Cássio

User contributions licensed under CC BY-SA 3.0