Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 816995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:55:27+00:00 2026-05-15T01:55:27+00:00

I have application with this code: Module Startup <STAThread()> _ Public Sub Main() Try

  • 0

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?

EDIT: unhandled exception from application is WebException thrown after failed web service call.

How can I handle this types of exceptions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:55:27+00:00Added an answer on May 15, 2026 at 1:55 am

    This is normal. There’s an exception handler built into the Application.Run() method. It is disabled when you debug in order to make debugging exceptions easier. Without a debugger, the exception handler will display the ThreadExceptionDialog.

    Add this statement at the top of your Main method to disable this exception handler:

       Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in my Mojolicious application module. When I run this
I have this code: app = new Application(); app.Visible = false; workbook = app.Workbooks.Add(1);
I have this code in my application If _oCurrentCall.CustomData.Length > 0 AndAlso UsageType =
I have this code in my ASP.NET application written in C# that is trying
I have this code to load icon and application name , but it is
I have this code in the end of link button click: Response.ContentType = application/zip;
Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
I have an application with some bunch of code like this: errCode = callMainSystem();
For eg, I have this code for my PHP calendar events application. /**MySQL code
I have erlang application. In this application i run process with spawn(?MODULE, my_foo, [my_param1,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.