[Mono-bugs] [Bug 70697][Nor] New - Non portable CLR generated by Mono. Crashes under .NET

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 20 Dec 2004 13:54:44 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by kevin.hubbard@siemens.com.

http://bugzilla.ximian.com/show_bug.cgi?id=70697

--- shadow/70697	2004-12-20 13:54:44.000000000 -0500
+++ shadow/70697.tmp.15157	2004-12-20 13:54:44.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 70697
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: Windows 2000 running .NET SDK 2.0Beta
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: kevin.hubbard@siemens.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Non portable CLR generated by Mono. Crashes under .NET
+
+#region Using directives
+ using System;
+ using System.IO;
+#endregion
+
+// Note: This example code crashes under .NET ( SDK 2.0beta ) If I compile it
+//       using Mono then execute under .NET, it crashes with:
+// Unhandled Exception: System.InvalidProgramException: Common Language Runtime
+//                      detected an invalid program at top.Main(String[] Args)
+// If I compile this code with .NET csc, or if I only execute it using Mono, 
+// then it works just fine.
+
+public class top   
+{
+ static String output_file_name = "foo.txt";  // Crashes
+ static String input_file_name  = "bar.txt"; 
+
+ static public void Main( string[] Args )
+ {
+
+//  String output_file_name = "foo.txt";  // Works
+
+  StreamWriter output_stream  = new StreamWriter( @output_file_name ,false );
+  output_stream.WriteLine("Hello");
+  output_stream.Close();
+
+  FileInfo     input_file = new FileInfo( @input_file_name );
+  StreamReader input_stream   = input_file.OpenText();
+  Console.WriteLine( input_stream.ReadLine() );
+  input_stream.Close();
+
+ } // main()
+} // top