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 / Visual Studio.NET / Debugging / March 2008

Tip: Looking for answers? Try searching our database.

Debug vs Release compile differences.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jamie Clayton - 13 Mar 2008 04:27 GMT
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.

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.