I have a program that is crashing on some machines (at a client of
ours). I have determined that it goes down on this line of code:
ToolStrip x = new ToolStrip();
I created a simple test app that only performs this one line of code.
It throws an exception so I know the problem is not caused by
something in my code. It seems like there is a problem with .NET. We
have tried uninstalling and reinstalling .NET 2, but it doesn't help.
Please, please, please, does anybody have any ideas? The following is
the exception info from my test app...
"Parameter is not valid"
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Argument Exception: Parameter is not valid.
at System.Drawing. Font.GetHeight( Graphics graphics)
at System.Drawing. Font.get_SizeIn Points()
at System.Drawing. SystemFonts.Fon tInPoints(Font font)
at System.Drawing. SystemFonts.get _MenuFont()
at System.Windows. Forms.ToolStrip Manager.get_Def aultFont()
at System.Windows. Forms.ToolStrip Item.get_Font()
at
System.Windows. Forms.ToolStrip ItemInternalLay out.CommonLayou tOptions()
at
System.Windows. Forms.ToolStrip DropDownButton. ToolStripDropDo wnButtonInterna lLayout.CommonL ayoutOptions()
at System.Windows. Forms.ToolStrip ItemInternalLay out.GetLayoutDa ta()
at System.Windows. Forms.ToolStrip ItemInternalLay out.PerformLayo ut()
at System.Windows. Forms.ToolStrip DropDownItem.On BoundsChanged()
at System.Windows. Forms.ToolStrip Item.SetBounds( Rectangle bounds)
at System.Windows. Forms.ToolStrip OverflowButton. SetBounds(Recta ngle
bounds)
at System.Windows. Forms.ToolStrip Item.set_Size(S ize value)
at System.Windows. Forms.ToolStrip .get_OverflowBu tton()
at
System.Windows. Forms.ToolStrip SplitStackLayou t.get_OverflowB uttonSize()
at
System.Windows. Forms.ToolStrip SplitStackLayou t.LayoutHorizon tal()
at
System.Windows. Forms.ToolStrip SplitStackLayou t.LayoutCore(IA rrangedElement
container, LayoutEventArgs layoutEventArgs )
at System.Windows. Forms.Layout.La youtEngine.Layo ut(Object
container, LayoutEventArgs layoutEventArgs )
at System.Windows. Forms.Control.O nLayout(LayoutE ventArgs levent)
at System.Windows. Forms.Scrollabl eControl.OnLayo ut(LayoutEventA rgs
levent)
at System.Windows. Forms.ToolStrip .OnLayout(Layou tEventArgs e)
at System.Windows. Forms.Control.P erformLayout(La youtEventArgs args)
at System.Windows. Forms.Control.P erformLayout()
at System.Windows. Forms.Control.R esumeLayout(Boo lean performLayout)
at System.Windows. Forms.ToolStrip ..ctor()
at WindowsApplicat ion2.Form1.butt on1_Click(Objec t sender, EventArgs
e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WindowsApplicat ion2
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/NextGen/WindowsApplicat ion2.exe
----------------------------------------
System.Windows. Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows. Forms/2.0.0.0__b77a5c 561934e089/System.Windows. Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c 561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f 7f11d50a3a/System.Drawing. dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuratio n>
<system.windows .forms jitDebugging="t rue" />
ours). I have determined that it goes down on this line of code:
ToolStrip x = new ToolStrip();
I created a simple test app that only performs this one line of code.
It throws an exception so I know the problem is not caused by
something in my code. It seems like there is a problem with .NET. We
have tried uninstalling and reinstalling .NET 2, but it doesn't help.
Please, please, please, does anybody have any ideas? The following is
the exception info from my test app...
"Parameter is not valid"
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Argument Exception: Parameter is not valid.
at System.Drawing. Font.GetHeight( Graphics graphics)
at System.Drawing. Font.get_SizeIn Points()
at System.Drawing. SystemFonts.Fon tInPoints(Font font)
at System.Drawing. SystemFonts.get _MenuFont()
at System.Windows. Forms.ToolStrip Manager.get_Def aultFont()
at System.Windows. Forms.ToolStrip Item.get_Font()
at
System.Windows. Forms.ToolStrip ItemInternalLay out.CommonLayou tOptions()
at
System.Windows. Forms.ToolStrip DropDownButton. ToolStripDropDo wnButtonInterna lLayout.CommonL ayoutOptions()
at System.Windows. Forms.ToolStrip ItemInternalLay out.GetLayoutDa ta()
at System.Windows. Forms.ToolStrip ItemInternalLay out.PerformLayo ut()
at System.Windows. Forms.ToolStrip DropDownItem.On BoundsChanged()
at System.Windows. Forms.ToolStrip Item.SetBounds( Rectangle bounds)
at System.Windows. Forms.ToolStrip OverflowButton. SetBounds(Recta ngle
bounds)
at System.Windows. Forms.ToolStrip Item.set_Size(S ize value)
at System.Windows. Forms.ToolStrip .get_OverflowBu tton()
at
System.Windows. Forms.ToolStrip SplitStackLayou t.get_OverflowB uttonSize()
at
System.Windows. Forms.ToolStrip SplitStackLayou t.LayoutHorizon tal()
at
System.Windows. Forms.ToolStrip SplitStackLayou t.LayoutCore(IA rrangedElement
container, LayoutEventArgs layoutEventArgs )
at System.Windows. Forms.Layout.La youtEngine.Layo ut(Object
container, LayoutEventArgs layoutEventArgs )
at System.Windows. Forms.Control.O nLayout(LayoutE ventArgs levent)
at System.Windows. Forms.Scrollabl eControl.OnLayo ut(LayoutEventA rgs
levent)
at System.Windows. Forms.ToolStrip .OnLayout(Layou tEventArgs e)
at System.Windows. Forms.Control.P erformLayout(La youtEventArgs args)
at System.Windows. Forms.Control.P erformLayout()
at System.Windows. Forms.Control.R esumeLayout(Boo lean performLayout)
at System.Windows. Forms.ToolStrip ..ctor()
at WindowsApplicat ion2.Form1.butt on1_Click(Objec t sender, EventArgs
e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WindowsApplicat ion2
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/NextGen/WindowsApplicat ion2.exe
----------------------------------------
System.Windows. Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows. Forms/2.0.0.0__b77a5c 561934e089/System.Windows. Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c 561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f 7f11d50a3a/System.Drawing. dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuratio n>
<system.windows .forms jitDebugging="t rue" />
Comment