Exception handling problem in release mode

Posted by lama-power on Stack Overflow See other posts from Stack Overflow or by lama-power
Published on 2010-05-29T23:24:59Z Indexed on 2010/05/29 23:32 UTC
Read the original article Hit count: 531

I have application with this code:

Module Startup
  <STAThread()> _
  Public Sub Main()
    Try
      Application.EnableVisualStyles()
      Application.SetCompatibleTextRenderingDefault(False)

      InitApp()

      Dim login As New LoginForm()
      Dim main As New MainForm()

      Application.Run(login)

      If login.DialogResult = DialogResult.OK Then
      ActUser = login.LoggedUser
      main.ShowDialog()
      End If

      DisposeApp()

    Catch ex As Exception
      ErrMsg(ex, "Error!", ErrorLogger.ErrMsgType.CriticalError)
      End 
    End Try
  End Sub
End Module

in debug mode everithing is OK. But in release mode when somewhere in application exception occurs my global catch in Main method doesn`t catch exception.

What is the problem please?

© Stack Overflow or respective owner

Related posts about exception

Related posts about exception-handling