我的服务器端代码出现异常,它正在提供一个 silverlight 应用程序,
Win32Exception - No such interface supported
由于第三方 dll 不是线程安全的,我们的服务器端 C# 代码为一个短任务启动了一个单独的进程。所以上面的错误出现在这样的部分代码中,
Process process = new Process();
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.CreateNoWindow = true;
processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
processStartInfo.FileName =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin", "PreviewGenerator.exe");
process.StartInfo = processStartInfo;
process.Start(); // THIS IS WHERE THE EXCEPTION OCCURS
process.WaitForExit();
PreviewGenerator.exe进程在不工作的时候不启动,异常出现在上面的注释处。
更新:
出现问题时,我已在 IIS 服务器上运行进程监视器。这说明w3wp进程是这样做的,
Thread Create
Access the file PreviewGenerator.exe
Hive unloaded (this is the registry)
Thread Exit
它在调用其他进程之前执行此操作。如果我在它工作时将它与进程监视器日志进行比较,它会这样做,
Thread Create
Access the file PreviewGenerator.exe
Process Start
Does heaps of stuff with PreviewGenerator.exe including reading / writing / registry, etc.
Process Exit
Hive unloaded
Thread Exit
但是进程监视器没有显示关于为什么第一种情况不起作用的任何信息。
有什么方法可以让我知道为什么线程过早退出?
此外,我认为这个问题与我的服务器加载更多以及使用更多内存的时间有关。我怎样才能证明这一点?
最佳答案
我有类似的问题,我用 processStartInfo.UseShellExecute = false; 这为我解决了问题。
http://www.progtown.com/topic31343-process-start-processstartinfo-startinfo.html
关于c# - No such interface supported 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9864217/