Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

Toolstrip Exception - bad .NET?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 09 Oct 2007 13:08 GMT
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" />
Peter Duniho - 09 Oct 2007 18:40 GMT
> [...duplicate post snipped...]

Please don't multi-post.  Learn to cross-post correctly, if you must
cross-post.

This exact same post was sent to the
microsoft.public.dotnet.languages.csharp newsgroup, and now people in
each newsgroup will not necessarily be aware of answers in the other
newsgroup, causing duplicated effort.

Assuming you get useful answers at all, of course.  I can't say that the
problem sounds like a programming problem.  More like some kind of
configuration issue.  Hard to say for sure, but it doesn't seem like the
sort of thing that will be solved by inspecting the code.

Pete
Mike - 09 Oct 2007 22:30 GMT
Thanks for the reply. What is the proper way to cross post? I
sometimes post in multiple groups because I might get a response in
one and not another.

I agree that the problem is not in the code. I was hoping that by
inspecting the exception info, someone might have an idea about what
is wrong with the framework on this machine. Any ideas?

>  > [...duplicate post snipped...]
>
[quoted text clipped - 12 lines]
>
> Pete
Peter Duniho - 10 Oct 2007 00:38 GMT
> Thanks for the reply. What is the proper way to cross post? I
> sometimes post in multiple groups because I might get a response in
> one and not another.

http://www.google.com/search?q=newsgroup+multi-post+cross-post
Mike - 10 Oct 2007 14:10 GMT
Thanks Peter! I've seen lots of people complain about multi-posting
(not just to me), but yours was the first time I've ever seen someone
offer an alternative. If I had known about it, I surely would have
done it that way. And I will in the future.

Thanks,
Mike

> > Thanks for the reply. What is the proper way to cross post? I
> > sometimes post in multiple groups because I might get a response in
> > one and not another.
>
> http://www.google.com/search?q=newsgroup+multi-post+cross-post

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.