G'day,
I've got a vb.net 2.1 window forms application that works as expected in the
VS2005 debug environment. However when I run the application under "Release"
configuration I get a weird error that crashes the application.
At the point of failure the application is doing the following logic.
1. Main form _Load event is firing.
2. User identity is being set via a commandline.arg option (bit of a cheat).
3. If a commandline.arg supplies a form name, then that forms
form.ShowDialog method fires.
4. A fast shut down the application after that form is closed (still in the
mainForm_Load event) will then occur.
Windows Xp.sp 2 + service packs
VS2005 sp1
.net framework 2.0 + sp1
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Microsoft.VisualBasic"
StackTrace:
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.MainFormLoadingDone(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd,
Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at Iims.Gui.My.MyApplication.Main(String[] Args)
If I enable unmanaged code debugging in "release" configuration I stop at
the following line:
User32.dll
7E418734 mov ecx,dword ptr fs:[18h]
Jamie Clayton - 13 Mar 2008 05:00 GMT
Please ignore this problem. I did a code review stepping through the
application from the first line of code and found a hidden
#If Debug
Application.Exit
#end If
in the MainForm_Load event. Will hunt down offending programmer in source
control!
> G'day,
>
> I've got a vb.net 2.1 window forms application that works as expected in the
> VS2005 debug environment. However when I run the application under "Release"
> configuration I get a weird error that crashes the application.