M
Mike
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.ArgumentException: Parameter is not valid.
at System.Drawing.Font.GetHeight(Graphics graphics)
at System.Drawing.Font.get_SizeInPoints()
at System.Drawing.SystemFonts.FontInPoints(Font font)
at System.Drawing.SystemFonts.get_MenuFont()
at System.Windows.Forms.ToolStripManager.get_DefaultFont()
at System.Windows.Forms.ToolStripItem.get_Font()
at
System.Windows.Forms.ToolStripItemInternalLayout.CommonLayoutOptions()
at
System.Windows.Forms.ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.CommonLayoutOptions()
at System.Windows.Forms.ToolStripItemInternalLayout.GetLayoutData()
at System.Windows.Forms.ToolStripItemInternalLayout.PerformLayout()
at System.Windows.Forms.ToolStripDropDownItem.OnBoundsChanged()
at System.Windows.Forms.ToolStripItem.SetBounds(Rectangle bounds)
at System.Windows.Forms.ToolStripOverflowButton.SetBounds(Rectangle
bounds)
at System.Windows.Forms.ToolStripItem.set_Size(Size value)
at System.Windows.Forms.ToolStrip.get_OverflowButton()
at
System.Windows.Forms.ToolStripSplitStackLayout.get_OverflowButtonSize()
at
System.Windows.Forms.ToolStripSplitStackLayout.LayoutHorizontal()
at
System.Windows.Forms.ToolStripSplitStackLayout.LayoutCore(IArrangedElement
container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Layout.LayoutEngine.Layout(Object
container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs
levent)
at System.Windows.Forms.ToolStrip.OnLayout(LayoutEventArgs e)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at System.Windows.Forms.Control.PerformLayout()
at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
at System.Windows.Forms.ToolStrip..ctor()
at WindowsApplication2.Form1.button1_Click(Object sender, EventArgs
e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr 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
----------------------------------------
WindowsApplication2
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/NextGen/WindowsApplication2.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__b77a5c561934e089/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__b77a5c561934e089/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__b03f5f7f11d50a3a/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:
<configuration>
<system.windows.forms jitDebugging="true" />
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.ArgumentException: Parameter is not valid.
at System.Drawing.Font.GetHeight(Graphics graphics)
at System.Drawing.Font.get_SizeInPoints()
at System.Drawing.SystemFonts.FontInPoints(Font font)
at System.Drawing.SystemFonts.get_MenuFont()
at System.Windows.Forms.ToolStripManager.get_DefaultFont()
at System.Windows.Forms.ToolStripItem.get_Font()
at
System.Windows.Forms.ToolStripItemInternalLayout.CommonLayoutOptions()
at
System.Windows.Forms.ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.CommonLayoutOptions()
at System.Windows.Forms.ToolStripItemInternalLayout.GetLayoutData()
at System.Windows.Forms.ToolStripItemInternalLayout.PerformLayout()
at System.Windows.Forms.ToolStripDropDownItem.OnBoundsChanged()
at System.Windows.Forms.ToolStripItem.SetBounds(Rectangle bounds)
at System.Windows.Forms.ToolStripOverflowButton.SetBounds(Rectangle
bounds)
at System.Windows.Forms.ToolStripItem.set_Size(Size value)
at System.Windows.Forms.ToolStrip.get_OverflowButton()
at
System.Windows.Forms.ToolStripSplitStackLayout.get_OverflowButtonSize()
at
System.Windows.Forms.ToolStripSplitStackLayout.LayoutHorizontal()
at
System.Windows.Forms.ToolStripSplitStackLayout.LayoutCore(IArrangedElement
container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Layout.LayoutEngine.Layout(Object
container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs
levent)
at System.Windows.Forms.ToolStrip.OnLayout(LayoutEventArgs e)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at System.Windows.Forms.Control.PerformLayout()
at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
at System.Windows.Forms.ToolStrip..ctor()
at WindowsApplication2.Form1.button1_Click(Object sender, EventArgs
e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr 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
----------------------------------------
WindowsApplication2
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/NextGen/WindowsApplication2.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__b77a5c561934e089/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__b77a5c561934e089/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__b03f5f7f11d50a3a/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:
<configuration>
<system.windows.forms jitDebugging="true" />