[Mono-bugs] [Bug 349108] New: Calling Application. Run with no parameters and clicking a MenuStrip throws a NullReferenceException
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sun Dec 16 18:15:23 EST 2007
https://bugzilla.novell.com/show_bug.cgi?id=349108
Summary: Calling Application.Run with no parameters and clicking
a MenuStrip throws a NullReferenceException
Product: Mono: Class Libraries
Version: 1.2.5
Platform: i686
OS/Version: Linux
Status: NEW
Severity: Major
Priority: P5 - None
Component: Windows.Forms
AssignedTo: mono-bugs at ximian.com
ReportedBy: ai2097 at users.sourceforge.net
QAContact: mono-bugs at ximian.com
Found By: Community of Practice
Created an attachment (id=187783)
--> (https://bugzilla.novell.com/attachment.cgi?id=187783)
Clicking "File" will cause the application to crash
Calling System.Windows.Forms.Application.Run() with no parameters is valid, and
should allow a program to continue executing even after all forms have been
closed. However, calling a form's Show() method, followed by a parameterless
call to Application.Run() leads to a NullReferenceException being thrown when
an attempt is made to interact with the form's MenuStrp control. If the form is
passed as a parameter to Application.Run, the NullReferenceExceptions are not
thrown, and the application works as expected.
Reproduction steps:
1. Compile the attached test code (gmcs -target:winexe -r:System.Windows.Forms
bug.cs)
2. Run the test code with mono
3. Click on the "File" menu item
Expected:
The file menu should expand.
Actual:
The program crashes with a NullReferenceException.
Other notes:
The same executable runs just fine under the Microsoft .NET implementation.
Furthermore, removing the form.Show() call and changing the Application.Run()
call to Application.Run(form) leads to the program running correctly under Mono
(i.e., this isn't a null reference problem in the testcase itself).
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list