dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] Spawning a process doesn't work


From: Bruno Haible
Subject: [Pnet-developers] Spawning a process doesn't work
Date: Sat, 20 Dec 2003 16:52:39 +0100
User-agent: KMail/1.5

Using pnet-0.6.0 on Linux.

Spawning a subprocess fails.

================================= hello.cs ================================
using System;
using System.Diagnostics;
class Hello {
  static void Main() {
    Process p = new Process();
    p.StartInfo.FileName = "/bin/pwd";
    p.StartInfo.RedirectStandardOutput = true;
    p.Start();
    String output = p.StandardOutput.ReadToEnd();
    p.WaitForExit();
    Console.WriteLine(output);
  }
}
============================================================================

$ cscc -winforms hello.cs -o hello.exe 
$ ilrun hello.exe
Uncaught exception: System.InvalidOperationException: Es trat eine unerlaubte 
Operation auf
        at System.Diagnostics.Process.Start() in ./Diagnostics/Process.cs
        at Hello.Main()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]