[Mono-bugs] [Bug 61675][Cri] New - Compiler bug and Runtime 1.0 error

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 16 Jul 2004 16:25:37 -0400 (EDT)


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 parjm@hotmail.com.

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

--- shadow/61675	2004-07-16 16:25:37.000000000 -0400
+++ shadow/61675.tmp.2860	2004-07-16 16:25:37.000000000 -0400
@@ -0,0 +1,430 @@
+Bug#: 61675
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: Windows XP, Windows 2000
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: parjm@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compiler bug and Runtime 1.0 error
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem: Compiler raises Error CS0246 Cannot find type
+`System.Windows.Forms.Form' when trying to compile C# code which uses any
+System.* components (Ex. System.Windows.Form, System.Drawing, etc.).
+However if the -r option is used to indicate the components used then the
+compiler compiles. Ex. mcs -r:System.Windows.Forms,System.Drawing
+swf-label.cs. After compiling running "mono swf-label.exe" raises the an
+unhandled exception error.
+
+Steps to reproduce the problem:
+1. Download source code from:
+http://home.pi.be/~xgboomer/monoswf/sources/swf-label.tar.bz2
+OR copy the code pasted in the additional information section.
+2. Extract it and run "mcs swf-label.cs", this will produce an error, run
+instead using, "mcs -r:System.Windows.Forms,System.Drawing swf-label.cs"
+and the compiler will compile. NOTE: When compiled using the -r option the
+.exe is runnable using Microsoft .NET distributable runtime.
+3. mono swf-label.exe
+
+Actual Results:
+Result of mcs without using the -r option:
+swf-label.cs(7) error CS0246: Cannot find type `System.Windows.Forms.Form'
+Compilation failed: 1 error(s), 0 warnings
+
+Result of mono:
+Unhandled Exception: System.TypeInitializationException: An exception was
+thrown
+ by the type initializer for System.Drawing.GDIPlus --->
+System.DllNotFoundExcep
+tion: gdiplus.dll
+in <0x00050> (wrapper managed-to-native)
+System.Drawing.GDIPlus:GdiplusStartup (
+ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
+
+in <0x00068> System.Drawing.GDIPlus:.cctor ()
+--- End of inner exception stack trace ---
+
+in (unmanaged) System.Drawing.GDIPlus:GetDC (intptr)
+in <0x00127> System.Drawing.Font:FromHfont (intptr)
+in <0x00015> System.Windows.Forms.Control:get_DefaultFont ()
+in <0x001af> System.Windows.Forms.Control:.ctor ()
+in <0x00010> System.Windows.Forms.ScrollableControl:.ctor ()
+in <0x00012> System.Windows.Forms.ContainerControl:.ctor ()
+in <0x00016> System.Windows.Forms.Form:.ctor ()
+in <0x0000a> MyFormProject.MainForm:.ctor ()
+in <0x0004c> (wrapper remoting-invoke-with-check)
+MyFormProject.MainForm:.ctor (
+)
+in <0x0001b> MyFormProject.MainForm:Main (string[])
+
+Expected Results: Form should load up displaying labels with different
+settings 
+
+How often does this happen? Everytime
+
+
+Additional Information: 
+SET PATH=h:\Mono-1.0\bin;%PATH%
+SET MONO_PATH=h:\Mono-1.0\lib
+SET MONO_CFG_DIR=h:\Mono-1.0\etc
+
+Source code swf-label.cs:
+using System;
+using System.Windows.Forms;
+
+namespace MyFormProject 
+{
+	class MainForm : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Label label;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Label label4;	
+		private System.Windows.Forms.Label label5;
+		private System.Windows.Forms.Label label6;		
+		private System.Windows.Forms.Label label7;
+		private System.Windows.Forms.Label label8;
+		private System.Windows.Forms.Label label9;
+		private System.Windows.Forms.Label label10;
+		private System.Windows.Forms.Label label11;
+		private System.Windows.Forms.Label label12;
+		private System.Windows.Forms.Label label13;
+		private System.Windows.Forms.Label label14;
+		private System.Windows.Forms.Label label15;
+		private System.Windows.Forms.Label label16;
+		private System.Windows.Forms.Label label17;		
+		private System.Windows.Forms.Label label18;
+		private System.Windows.Forms.Label label19;
+		private System.Windows.Forms.Label label20;
+    	private System.Windows.Forms.Label label21;
+		private System.Windows.Forms.Label label22;
+		private System.Windows.Forms.Label label23;
+		private System.Windows.Forms.Label label24;
+		private System.Windows.Forms.Label label25;
+
+		public MainForm()
+		{
+			InitializeComponent();
+		}
+	
+		// THIS METHOD IS MAINTAINED BY THE FORM DESIGNER
+		// DO NOT EDIT IT MANUALLY! YOUR CHANGES ARE LIKELY TO BE LOST
+		void InitializeComponent() {
+			this.label22 = new System.Windows.Forms.Label();
+			this.label23 = new System.Windows.Forms.Label();
+			this.label8 = new System.Windows.Forms.Label();
+			this.label9 = new System.Windows.Forms.Label();
+			this.label4 = new System.Windows.Forms.Label();
+			this.label5 = new System.Windows.Forms.Label();
+			this.label6 = new System.Windows.Forms.Label();
+			this.label7 = new System.Windows.Forms.Label();
+			this.label2 = new System.Windows.Forms.Label();
+			this.label3 = new System.Windows.Forms.Label();
+			this.label15 = new System.Windows.Forms.Label();
+			this.label14 = new System.Windows.Forms.Label();
+			this.label17 = new System.Windows.Forms.Label();
+			this.label16 = new System.Windows.Forms.Label();
+			this.label11 = new System.Windows.Forms.Label();
+			this.label10 = new System.Windows.Forms.Label();
+			this.label13 = new System.Windows.Forms.Label();
+			this.label20 = new System.Windows.Forms.Label();
+			this.label21 = new System.Windows.Forms.Label();
+			this.label24 = new System.Windows.Forms.Label();
+			this.label25 = new System.Windows.Forms.Label();
+			this.label19 = new System.Windows.Forms.Label();
+			this.label18 = new System.Windows.Forms.Label();
+			this.label12 = new System.Windows.Forms.Label();
+			this.label = new System.Windows.Forms.Label();
+			this.SuspendLayout();
+			// 
+			// label22
+			// 
+			this.label22.Dock = System.Windows.Forms.DockStyle.Top;
+			this.label22.Location = new System.Drawing.Point(0, 0);
+			this.label22.Name = "label22";
+			this.label22.Size = new System.Drawing.Size(480, 16);
+			this.label22.TabIndex = 21;
+			this.label22.Text = "A normal label : Dock=Top";
+			// 
+			// label23
+			// 
+			this.label23.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.label23.Location = new System.Drawing.Point(0, 517);
+			this.label23.Name = "label23";
+			this.label23.Size = new System.Drawing.Size(480, 16);
+			this.label23.TabIndex = 22;
+			this.label23.Text = "A normal label : Dock=Bottom";
+			// 
+			// label8
+			// 
+			this.label8.Location = new System.Drawing.Point(10, 125);
+			this.label8.Name = "label8";
+			this.label8.Size = new System.Drawing.Size(464, 16);
+			this.label8.TabIndex = 7;
+			this.label8.Text = "A normal label : TextAlign=MiddleLeft";
+			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// label9
+			// 
+			this.label9.Location = new System.Drawing.Point(10, 185);
+			this.label9.Name = "label9";
+			this.label9.Size = new System.Drawing.Size(464, 16);
+			this.label9.TabIndex = 8;
+			this.label9.Text = "A normal label : TextAlign=BottomLeft";
+			this.label9.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
+			// 
+			// label4
+			// 
+			this.label4.Location = new System.Drawing.Point(10, 85);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(464, 16);
+			this.label4.TabIndex = 3;
+			this.label4.Text = "A normal label : TextAlign=TopCenter";
+			this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter;
+			// 
+			// label5
+			// 
+			this.label5.Location = new System.Drawing.Point(10, 145);
+			this.label5.Name = "label5";
+			this.label5.Size = new System.Drawing.Size(464, 16);
+			this.label5.TabIndex = 4;
+			this.label5.Text = "A normal label : TextAlign=MiddleCenter";
+			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+			// 
+			// label6
+			// 
+			this.label6.Location = new System.Drawing.Point(10, 165);
+			this.label6.Name = "label6";
+			this.label6.Size = new System.Drawing.Size(464, 16);
+			this.label6.TabIndex = 5;
+			this.label6.Text = "A normal label : TextAlign=MiddleRight";
+			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// label7
+			// 
+			this.label7.Location = new System.Drawing.Point(10, 105);
+			this.label7.Name = "label7";
+			this.label7.Size = new System.Drawing.Size(464, 16);
+			this.label7.TabIndex = 6;
+			this.label7.Text = "A normal label : TextAlign=TopRight";
+			this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
+			// 
+			// label2
+			// 
+			this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+			this.label2.Location = new System.Drawing.Point(10, 45);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(464, 16);
+			this.label2.TabIndex = 1;
+			this.label2.Text = "A normal label : BorderStyle=FixedSingle";
+			// 
+			// label3
+			// 
+			this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+			this.label3.Location = new System.Drawing.Point(10, 65);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(464, 16);
+			this.label3.TabIndex = 2;
+			this.label3.Text = "A normal label : BorderStyle=Fixed3D";
+			// 
+			// label15
+			// 
+			this.label15.Font = new System.Drawing.Font("Microsoft Sans Serif",
+8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point,
+((System.Byte)(0)));
+			this.label15.Location = new System.Drawing.Point(10, 305);
+			this.label15.Name = "label15";
+			this.label15.Size = new System.Drawing.Size(464, 16);
+			this.label15.TabIndex = 14;
+			this.label15.Text = "A normal label : Font.Italic=true";
+			// 
+			// label14
+			// 
+			this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif",
+8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
+((System.Byte)(0)));
+			this.label14.Location = new System.Drawing.Point(10, 285);
+			this.label14.Name = "label14";
+			this.label14.Size = new System.Drawing.Size(464, 16);
+			this.label14.TabIndex = 13;
+			this.label14.Text = "A normal label : Font.Bold=true";
+			// 
+			// label17
+			// 
+			this.label17.Font = new System.Drawing.Font("Microsoft Sans Serif",
+8.25F, System.Drawing.FontStyle.Underline,
+System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+			this.label17.Location = new System.Drawing.Point(10, 345);
+			this.label17.Name = "label17";
+			this.label17.Size = new System.Drawing.Size(464, 16);
+			this.label17.TabIndex = 16;
+			this.label17.Text = "A normal label : Font.Underline=true";
+			// 
+			// label16
+			// 
+			this.label16.Font = new System.Drawing.Font("Microsoft Sans Serif",
+8.25F, System.Drawing.FontStyle.Strikeout,
+System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+			this.label16.Location = new System.Drawing.Point(10, 325);
+			this.label16.Name = "label16";
+			this.label16.Size = new System.Drawing.Size(464, 16);
+			this.label16.TabIndex = 15;
+			this.label16.Text = "A normal label : Font.Strikeout=true";
+			// 
+			// label11
+			// 
+			this.label11.Location = new System.Drawing.Point(10, 225);
+			this.label11.Name = "label11";
+			this.label11.Size = new System.Drawing.Size(464, 16);
+			this.label11.TabIndex = 10;
+			this.label11.Text = "A normal label : TextAlign=BottomRight";
+			this.label11.TextAlign = System.Drawing.ContentAlignment.BottomRight;
+			// 
+			// label10
+			// 
+			this.label10.Location = new System.Drawing.Point(10, 205);
+			this.label10.Name = "label10";
+			this.label10.Size = new System.Drawing.Size(464, 16);
+			this.label10.TabIndex = 9;
+			this.label10.Text = "A normal label : TextAlign=BottomCenter";
+			this.label10.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+			// 
+			// label13
+			// 
+			this.label13.ForeColor = System.Drawing.Color.Red;
+			this.label13.Location = new System.Drawing.Point(10, 265);
+			this.label13.Name = "label13";
+			this.label13.Size = new System.Drawing.Size(464, 16);
+			this.label13.TabIndex = 12;
+			this.label13.Text = "A normal label : ForeColor=Red";
+			// 
+			// label20
+			// 
+			this.label20.BackColor = System.Drawing.SystemColors.Control;
+			this.label20.Enabled = false;
+			this.label20.Location = new System.Drawing.Point(10, 405);
+			this.label20.Name = "label20";
+			this.label20.Size = new System.Drawing.Size(464, 16);
+			this.label20.TabIndex = 19;
+			this.label20.Text = "A normal label : Enabled=false";
+			// 
+			// label21
+			// 
+			this.label21.Anchor =
+((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top
+| System.Windows.Forms.AnchorStyles.Bottom) 
+						| System.Windows.Forms.AnchorStyles.Left) 
+						| System.Windows.Forms.AnchorStyles.Right)));
+			this.label21.BackColor = System.Drawing.SystemColors.Control;
+			this.label21.Location = new System.Drawing.Point(10, 495);
+			this.label21.Name = "label21";
+			this.label21.Size = new System.Drawing.Size(460, 15);
+			this.label21.TabIndex = 20;
+			this.label21.Text = "A normal label : Anchor=All";
+			// 
+			// label24
+			// 
+			this.label24.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+			this.label24.Location = new System.Drawing.Point(10, 425);
+			this.label24.Name = "label24";
+			this.label24.Size = new System.Drawing.Size(464, 40);
+			this.label24.TabIndex = 23;
+			this.label24.Text = "A normal label : BorderStyle=FixedSingle , Height=40";
+			// 
+			// label25
+			// 
+			this.label25.AutoSize = true;
+			this.label25.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+			this.label25.Location = new System.Drawing.Point(10, 470);
+			this.label25.Name = "label25";
+			this.label25.Size = new System.Drawing.Size(294, 19);
+			this.label25.TabIndex = 24;
+			this.label25.Text = "A normal label : BorderStyle=FixedSingle ,
+AutoSize=true";
+			// 
+			// label19
+			// 
+			this.label19.BackColor = System.Drawing.Color.Red;
+			this.label19.Location = new System.Drawing.Point(10, 385);
+			this.label19.Name = "label19";
+			this.label19.Size = new System.Drawing.Size(464, 16);
+			this.label19.TabIndex = 18;
+			this.label19.Text = "A normal label : BackColor=Red";
+			// 
+			// label18
+			// 
+			this.label18.Font = new System.Drawing.Font("Verdana", 9.75F,
+System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
+((System.Byte)(0)));
+			this.label18.Location = new System.Drawing.Point(10, 365);
+			this.label18.Name = "label18";
+			this.label18.Size = new System.Drawing.Size(464, 16);
+			this.label18.TabIndex = 17;
+			this.label18.Text = "A normal label : Font=Verdana; 9.75pt";
+			// 
+			// label12
+			// 
+			this.label12.Location = new System.Drawing.Point(10, 245);
+			this.label12.Name = "label12";
+			this.label12.Size = new System.Drawing.Size(464, 16);
+			this.label12.TabIndex = 11;
+			this.label12.Text = "A normal label : With a &shortcut letter (Alt+S)";
+			// 
+			// label
+			// 
+			this.label.Location = new System.Drawing.Point(10, 25);
+			this.label.Name = "label";
+			this.label.Size = new System.Drawing.Size(464, 16);
+			this.label.TabIndex = 0;
+			this.label.Text = "A normal label";
+			// 
+			// MainForm
+			// 
+			this.ClientSize = new System.Drawing.Size(480, 533);
+			this.Controls.AddRange(new System.Windows.Forms.Control[] {
+						this.label25,
+						this.label24,
+						this.label23,
+						this.label22,
+						this.label21,
+						this.label20,
+						this.label19,
+						this.label18,
+						this.label17,
+						this.label16,
+						this.label15,
+						this.label14,
+						this.label13,
+						this.label12,
+						this.label11,
+						this.label10,
+						this.label9,
+						this.label8,
+						this.label7,
+						this.label6,
+						this.label5,
+						this.label4,
+						this.label3,
+						this.label2,
+						this.label});
+			this.Text = "SWF-Labels";
+			this.ResumeLayout(false);
+		}
+			
+		[STAThread]
+		public static void Main(string[] args)
+		{
+			Application.Run(new MainForm());
+		}
+	}			
+}