【发布时间】:2014-01-22 01:42:01
【问题描述】:
我有一个控制台应用程序在直接启动时运行良好。但是,如果我从 .NET 应用程序启动应用程序,我会收到错误 12538,这似乎是一个协议错误。
ProcessStartInfo startInfo = new ProcessStartInfo(executable, args);
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process p = new Process();
p.StartInfo = startInfo;
p.EnableRaisingEvents = true;
p.OutputDataReceived += new DataReceivedEventHandler(OnDataReceived);
p.ErrorDataReceived += new DataReceivedEventHandler(OnErrorReceived);
p.Exited += new EventHandler(OnProcessExit);
p.Start();
p.BeginOutputReadLine();
p.BeginErrorReadLine();
p.WaitForExit();
知道是什么原因造成的吗?当控制台应用程序使用 32 位时,.NET 应用程序确实使用 64 位 Oracle,但我认为这并不重要,因为它们不在同一个内存空间中(或者至少不应该)
【问题讨论】: