在Windows服务中运行程序并获取"Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"



我创建了一个程序,它通过COM注册表启动另一个程序。主例程如下所示:

ProcessStartInfo start = new ProcessStartInfo();
start.FileName = @"E:MainDebugExecutive.exe";
start.WindowStyle = ProcessWindowStyle.Hidden;
start.CreateNoWindow = true;
start.Arguments = "/run " + arguments[0];
using (Process proc = Process.Start(start))...

Executive.exe将通过查看注册表来启动另一个程序。如果我在VS2013中或通过命令行运行这个例程,一切正常。但是如果我把它放在一个windows服务的protected override void OnStart(string[] args)方法中。我将得到Class not registered错误。有什么建议吗?主要目标是将Executive.exe作为Windows服务运行。

过去,当我们遇到这个问题时,我们很幸运地使用regsvr32.exe Windows命令行实用程序来注册dll。更多信息请点击这里

相关内容

最新更新